code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: google.inc.php 16697 2008-11-14 07:36:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if($requestrun) { $writedata = !empty($GLOBALS['google']) ? '<div id="headsearch" class="sidebox"><script type="text/javascript"> var google_host="'.$_SERVER['HTTP_HOST'].'", google_charset="'.$GLOBALS['charset'].'", google_hl="'.$settings['lang'].'", google_lr="'.($settings['lang'] ? 'lang_'.$settings['lang'] : '').'"; google_default_0="'.($settings['default'] == 0 ? ' selected' : '').'"; google_default_1="'.($settings['default'] == 1 ? ' selected' : '').'"; </script> <script type="text/javascript" src="include/js/google.js"></script></div> ' : ''; } else { $request_version = '1.0'; $request_name = $requestlang['google_name']; $request_description = $requestlang['google_desc']; $request_copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>'; $request_settings = array( 'lang' => array($requestlang['google_lang'], $requestlang['google_lang_comment'], 'mradio', array( array('', $requestlang['google_lang_any']), array('en', $requestlang['google_lang_en']), array('zh-CN', $requestlang['google_lang_zh-CN']), array('zh-TW', $requestlang['google_lang_zh-TW'])) ), 'default' => array($requestlang['google_default'], $requestlang['google_default_comment'], 'mradio', array( array(0, $requestlang['google_default_0']), array(1, $requestlang['google_default_1'])) ), ); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/request/google.inc.php
PHP
asf20
1,634
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: html.inc.php 16697 2008-11-14 07:36:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if($requestrun) { $settings['code'] = stripslashes($settings['code']); if($settings['type']) { include_once DISCUZ_ROOT.'./include/discuzcode.func.php'; $writedata = discuzcode($settings['code'], 0, 0); } else { $writedata = $settings['code']; } if($settings['side']) { $writedata = '<div class="sidebox">'.$writedata.'</div>'; } } else { $request_version = '1.0'; $request_name = $requestlang['html_name']; $request_description = $requestlang['html_desc']; $request_copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>'; $request_settings = array( 'type' => array($requestlang['html_type'], $requestlang['html_type_comment'], 'select', array( array('0', $requestlang['html_type_html']), array('1', $requestlang['html_type_code']) ) ), 'code' => array($requestlang['html_code'], $requestlang['html_code_comment'], 'textarea'), 'side' => array($requestlang['html_side'], $requestlang['html_side_comment'], 'radio'), ); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/request/html.inc.php
PHP
asf20
1,262
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: viewthread_poll.inc.php 18454 2009-05-22 01:52:27Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $polloptions = array(); $votersuid = ''; if($count = $sdb->fetch_first("SELECT MAX(votes) AS max, SUM(votes) AS total FROM {$tablepre}polloptions WHERE tid = '$tid'")) { $options = $sdb->fetch_first("SELECT multiple, visible, maxchoices, expiration, overt FROM {$tablepre}polls WHERE tid='$tid'"); $multiple = $options['multiple']; $visible = $options['visible']; $maxchoices = $options['maxchoices']; $expiration = $options['expiration']; $overt = $options['overt']; $query = $sdb->query("SELECT polloptionid, votes, polloption, voterids FROM {$tablepre}polloptions WHERE tid='$tid' ORDER BY displayorder"); $voterids = ''; $bgcolor = rand(0, 9); while($options = $sdb->fetch_array($query)) { if($bgcolor > 9) { $bgcolor = 0; } $viewvoteruid[] = $options['voterids']; $voterids .= "\t".$options['voterids']; $polloptions[] = array ( 'polloptionid' => $options['polloptionid'], 'polloption' => preg_replace("/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $options['polloption']), 'votes' => $options['votes'], 'width' => @round($options['votes'] * 300 / $count['max']) + 2, 'percent' => @sprintf("%01.2f", $options['votes'] * 100 / $count['total']), 'color' => $bgcolor ); $bgcolor++; } $voterids = explode("\t", $voterids); $voters = array_unique($voterids); $voterscount = count($voters) - 1; array_shift($voters); if(!$expiration) { $expirations = $timestamp + 86400; } else { $expirations = $expiration; if($expirations > $timestamp) { $thread['remaintime'] = remaintime($expirations - $timestamp); } } $allwvoteusergroup = $allowvote; $allowvotepolled = !in_array(($discuz_uid ? $discuz_uid : $onlineip), $voters); $allowvotethread = (!$thread['closed'] && !checkautoclose() || $alloweditpoll) && $timestamp < $expirations && $expirations > 0; $allowvote = $allwvoteusergroup && $allowvotepolled && $allowvotethread; $optiontype = $multiple ? 'checkbox' : 'radio'; $visiblepoll = $visible || $forum['ismoderator'] || ($discuz_uid && $discuz_uid == $thread['authorid']) || ($expirations >= $timestamp && in_array(($discuz_uid ? $discuz_uid : $onlineip), $voters)) || $expirations < $timestamp ? 0 : 1; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/viewthread_poll.inc.php
PHP
asf20
2,627
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: common.inc.php 21331 2010-01-06 06:42:22Z cnteacher $ */ error_reporting(0); set_magic_quotes_runtime(0); $mtime = explode(' ', microtime()); $discuz_starttime = $mtime[1] + $mtime[0]; define('SYS_DEBUG', FALSE); define('IN_DISCUZ', TRUE); define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -7)); define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc()); //!defined('CURSCRIPT') && define('CURSCRIPT', ''); if(PHP_VERSION < '4.1.0') { $_GET = &$HTTP_GET_VARS; $_POST = &$HTTP_POST_VARS; $_COOKIE = &$HTTP_COOKIE_VARS; $_SERVER = &$HTTP_SERVER_VARS; $_ENV = &$HTTP_ENV_VARS; $_FILES = &$HTTP_POST_FILES; } if (isset($_REQUEST['GLOBALS']) OR isset($_FILES['GLOBALS'])) { exit('Request tainting attempted.'); } require_once DISCUZ_ROOT.'./include/global.func.php'; getrobot(); if(defined('NOROBOT') && IS_ROBOT) { exit(header("HTTP/1.1 403 Forbidden")); } foreach(array('_COOKIE', '_POST', '_GET') as $_request) { foreach($$_request as $_key => $_value) { $_key{0} != '_' && $$_key = daddslashes($_value); } } if (!MAGIC_QUOTES_GPC && $_FILES) { $_FILES = daddslashes($_FILES); } $charset = $dbs = $dbcharset = $forumfounders = $metakeywords = $extrahead = $seodescription = $mnid = ''; $plugins = $admincp = $scriptlang = $forum = $thread = $language = $jsmenu = $actioncode = $modactioncode = $pluginclasses = $hooks = $lang = array(); $_DCOOKIE = $_DSESSION = $_DCACHE = $_DPLUGIN = $advlist = array(); require_once DISCUZ_ROOT.'./config.inc.php'; if($urlxssdefend && !empty($_SERVER['REQUEST_URI'])) { $temp = urldecode($_SERVER['REQUEST_URI']); if(strpos($temp, '<') !== false || strpos($temp, '"') !== false) exit('Request Bad url'); } $prelength = strlen($cookiepre); foreach($_COOKIE as $key => $val) { if(substr($key, 0, $prelength) == $cookiepre) { $_DCOOKIE[(substr($key, $prelength))] = MAGIC_QUOTES_GPC ? $val : daddslashes($val); } } unset($prelength, $_request, $_key, $_value); $inajax = !empty($inajax); $handlekey = !empty($handlekey) ? htmlspecialchars($handlekey) : ''; $timestamp = time(); if($attackevasive && (!define('CURSCRIPT') || CURSCRIPT != 'seccode')) { require_once DISCUZ_ROOT.'./include/security.inc.php'; } require_once DISCUZ_ROOT.'./include/db_'.$database.'.class.php'; $PHP_SELF = dhtmlspecialchars($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']); $BASESCRIPT = basename($PHP_SELF); list($BASEFILENAME) = explode('.', $BASESCRIPT); $boardurl = htmlspecialchars('http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api|archiver|wap)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/'); if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) { $onlineip = getenv('HTTP_CLIENT_IP'); } elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) { $onlineip = getenv('HTTP_X_FORWARDED_FOR'); } elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) { $onlineip = getenv('REMOTE_ADDR'); } elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) { $onlineip = $_SERVER['REMOTE_ADDR']; } preg_match("/[\d\.]{7,15}/", $onlineip, $onlineipmatches); $onlineip = $onlineipmatches[0] ? $onlineipmatches[0] : 'unknown'; unset($onlineipmatches); $cachelost = (@include DISCUZ_ROOT.'./forumdata/cache/cache_settings.php') ? '' : 'settings'; @extract($_DCACHE['settings']); if(defined('BINDDOMAIN') && BINDDOMAIN && !$cachelost && $binddomains && $forumdomains) { $loadforum = isset($binddomains[$_SERVER['HTTP_HOST']]) ? max(0, intval($binddomains[$_SERVER['HTTP_HOST']])) : 0; if($loadforum) { if(BINDDOMAIN == 'forumdisplay' && $loadforum == $fid) { header("HTTP/1.1 301 Moved Permanently"); $query_string = preg_replace('/\??fid='.$fid.'&?/is', '', $_SERVER['QUERY_STRING']); dheader("Location: http://$_SERVER[HTTP_HOST]/{$indexname}".($query_string ? "?{$query_string}" : '')); } if(BINDDOMAIN == 'index') { $fid = $_GET['fid'] = $_REQUEST['fid'] = $loadforum; define('CURSCRIPT', 'forumdisplay'); } } else { if(BINDDOMAIN == 'forumdisplay' && isset($forumdomains[$fid])) { $host = $forumdomains[$fid]; header("HTTP/1.1 301 Moved Permanently"); dheader("Location: http://{$host}/{$indexname}"); } define('CURSCRIPT', BINDDOMAIN); } } if(!defined('CURSCRIPT')) { define('CURSCRIPT', defined('BINDDOMAIN') ? BINDDOMAIN : ''); } if(!defined('STAT_ID') && isset($statdisable) && empty($statdisable)) { define('STAT_ID', $_DCACHE['settings']['statid']); define('STAT_KEY', $_DCACHE['settings']['statkey']); } if($gzipcompress && function_exists('ob_gzhandler') && !in_array(CURSCRIPT, array('attachment', 'wap')) && !$inajax) { ob_start('ob_gzhandler'); } else { $gzipcompress = 0; ob_start(); } if(!empty($loadctrl) && substr(PHP_OS, 0, 3) != 'WIN') { if($fp = @fopen('/proc/loadavg', 'r')) { list($loadaverage) = explode(' ', fread($fp, 6)); fclose($fp); if($loadaverage > $loadctrl) { header("HTTP/1.0 503 Service Unavailable"); include DISCUZ_ROOT.'./include/serverbusy.htm'; exit(); } } } if(in_array(CURSCRIPT, array('index', 'forumdisplay', 'viewthread', 'post', 'topicadmin', 'register', 'archiver'))) { $cachelost .= (@include DISCUZ_ROOT.'./forumdata/cache/cache_'.CURSCRIPT.'.php') ? '' : ' '.CURSCRIPT; } $db = new dbstuff; $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset); $dbuser = $dbpw = $pconnect = $sdb = NULL; $sid = daddslashes(($transsidstatus || CURSCRIPT == 'wap') && (isset($_GET['sid']) || isset($_POST['sid'])) ? (isset($_GET['sid']) ? $_GET['sid'] : $_POST['sid']) : (isset($_DCOOKIE['sid']) ? $_DCOOKIE['sid'] : '')); CURSCRIPT == 'attachment' && isset($_GET['sid']) && $sid = addslashes(authcode($_GET['sid'], 'DECODE', $_DCACHE['settings']['authkey'])); $discuz_auth_key = md5($_DCACHE['settings']['authkey'].$_SERVER['HTTP_USER_AGENT']); list($discuz_pw, $discuz_secques, $discuz_uid) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1); $prompt = $sessionexists = $seccode = 0; $membertablefields = 'm.uid AS discuz_uid, m.username AS discuz_user, m.password AS discuz_pw, m.secques AS discuz_secques, m.adminid, m.groupid, m.groupexpiry, m.extgroupids, m.email, m.timeoffset, m.tpp, m.ppp, m.posts, m.threads, m.digestposts, m.oltime, m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6, m.extcredits7, m.extcredits8, m.timeformat, m.dateformat, m.pmsound, m.sigstatus, m.invisible, m.lastvisit, m.lastactivity, m.lastpost, m.prompt, m.accessmasks, m.editormode, m.customshow, m.customaddfeed, m.newbietaskid'; if($sid) { if($discuz_uid) { $query = $db->query("SELECT s.sid, s.styleid, s.groupid='6' AS ipbanned, s.pageviews AS spageviews, s.lastolupdate, s.seccode, $membertablefields FROM {$tablepre}sessions s, {$tablepre}members m WHERE m.uid=s.uid AND s.sid='$sid' AND CONCAT_WS('.',s.ip1,s.ip2,s.ip3,s.ip4)='$onlineip' AND m.uid='$discuz_uid' AND m.password='$discuz_pw' AND m.secques='$discuz_secques'"); } else { $query = $db->query("SELECT sid, uid AS sessionuid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode FROM {$tablepre}sessions WHERE sid='$sid' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='$onlineip'"); } if($_DSESSION = $db->fetch_array($query)) { $sessionexists = 1; if(!empty($_DSESSION['sessionuid'])) { $_DSESSION = array_merge($_DSESSION, $db->fetch_first("SELECT $membertablefields FROM {$tablepre}members m WHERE uid='$_DSESSION[sessionuid]'")); } } else { if($_DSESSION = $db->fetch_first("SELECT sid, groupid, groupid='6' AS ipbanned, pageviews AS spageviews, styleid, lastolupdate, seccode FROM {$tablepre}sessions WHERE sid='$sid' AND CONCAT_WS('.',ip1,ip2,ip3,ip4)='$onlineip'")) { clearcookies(); $sessionexists = 1; } } } if(!$sessionexists) { if($discuz_uid) { if(!($_DSESSION = $db->fetch_first("SELECT $membertablefields, m.styleid FROM {$tablepre}members m WHERE m.uid='$discuz_uid' AND m.password='$discuz_pw' AND m.secques='$discuz_secques'"))) { clearcookies(); } } if(ipbanned($onlineip)) $_DSESSION['ipbanned'] = 1; $_DSESSION['sid'] = random(6); $_DSESSION['seccode'] = random(6, 1); } $_DSESSION['dateformat'] = empty($_DSESSION['dateformat']) || empty($_DCACHE['settings']['userdateformat'][$_DSESSION['dateformat'] -1])? $_DCACHE['settings']['dateformat'] : $_DCACHE['settings']['userdateformat'][$_DSESSION['dateformat'] -1]; $_DSESSION['timeformat'] = empty($_DSESSION['timeformat']) ? $_DCACHE['settings']['timeformat'] : ($_DSESSION['timeformat'] == 1 ? 'h:i A' : 'H:i'); $_DSESSION['timeoffset'] = isset($_DSESSION['timeoffset']) && $_DSESSION['timeoffset'] != 9999 ? $_DSESSION['timeoffset'] : $_DCACHE['settings']['timeoffset']; $membertablefields = ''; @extract($_DSESSION); $disableprompt = !empty($_DCOOKIE['disableprompt']) ? explode('|', $_DCOOKIE['disableprompt']) : array(); if($prompt) { if($taskon && ($prompt & 8)) { $prompts['newbietask'] = 1; $disallowfloat = str_replace('task', '', $disallowfloat); $disallowfloat .= '|newthread|reply'; $editormode = 0; } $prompt = 0; $query = $db->query("SELECT typeid, number FROM {$tablepre}prompt WHERE uid='$discuz_uid'"); while($promptrow = $db->fetch_array($query)) { if($disableprompt && in_array($promptkeys[$promptrow['typeid']], $disableprompt)) { continue; } $prompt = $promptrow['number'] ? 1 : $prompt; $prompts[$promptkeys[$promptrow['typeid']]]['new'] = $promptrow['number']; } } if($announcepm && !in_array('announcepm', $disableprompt)) { $prompts['announcepm']['new'] = $announcepm; } $lastvisit = empty($lastvisit) ? $timestamp - 86400 : $lastvisit; $timenow = array('time' => gmdate("$dateformat $timeformat", $timestamp + 3600 * $timeoffset), 'offset' => ($timeoffset >= 0 ? ($timeoffset == 0 ? '' : '+'.$timeoffset) : $timeoffset)); if(PHP_VERSION > '5.1') { @date_default_timezone_set('Etc/GMT'.($timeoffset > 0 ? '-' : '+').(abs($timeoffset))); } $accessadd1 = $accessadd2 = $modadd1 = $modadd2 = $metadescription = $hookscriptmessage = ''; if(empty($discuz_uid) || empty($discuz_user)) { $discuz_user = $extgroupids = ''; $discuz_uid = $adminid = $posts = $digestposts = $pageviews = $oltime = $invisible = $credits = $extcredits1 = $extcredits2 = $extcredits3 = $extcredits4 = $extcredits5 = $extcredits6 = $extcredits7 = $extcredits8 = 0; $groupid = empty($groupid) || $groupid != 6 ? 7 : 6; } else { $discuz_userss = $discuz_user; $discuz_user = addslashes($discuz_user); if($accessmasks) { $accessadd1 = ', a.allowview, a.allowpost, a.allowreply, a.allowgetattach, a.allowpostattach'; $accessadd2 = "LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid"; } if($adminid == 3) { $modadd1 = ', m.uid AS ismoderator'; $modadd2 = "LEFT JOIN {$tablepre}moderators m ON m.uid='$discuz_uid' AND m.fid=f.fid"; } } if($errorreport == 2 || ($errorreport == 1 && $adminid > 0)) { error_reporting(E_ERROR | E_WARNING | E_PARSE); } define('FORMHASH', formhash()); $statstatus && !$inajax && require_once DISCUZ_ROOT.'./include/counter.inc.php'; $extra = isset($extra) && @preg_match("/^[&=;a-z0-9]+$/i", $extra) ? $extra : ''; $rsshead = $navtitle = $navigation = ''; $_DSESSION['groupid'] = $groupid = empty($ipbanned) ? (empty($groupid) ? 7 : intval($groupid)) : 6; if(!@include DISCUZ_ROOT.'./forumdata/cache/usergroup_'.$groupid.'.php') { $grouptype = $db->result_first("SELECT type FROM {$tablepre}usergroups WHERE groupid='$groupid'"); if(!empty($grouptype)) { $cachelost .= ' usergroup_'.$groupid; } else { $grouptype = 'member'; } } /* $link_login = 'logging.php?action=login'; $link_logout = 'logging.php?action=logout&amp;formhash='.FORMHASH; $link_register = $regname; */ if($discuz_uid && $_DSESSION) { if(!empty($groupexpiry) && $groupexpiry < $timestamp && !in_array(CURSCRIPT, array('wap', 'member'))) { dheader("Location: {$boardurl}member.php?action=groupexpiry"); } elseif($grouptype && $groupid != getgroupid($discuz_uid, array ( 'type' => $grouptype, 'creditshigher' => $groupcreditshigher, 'creditslower' => $groupcreditslower ), $_DSESSION)) { @extract($_DSESSION); $cachelost .= (@include DISCUZ_ROOT.'./forumdata/cache/usergroup_'.intval($groupid).'.php') ? '' : ' usergroup_'.$groupid; } } if(!in_array($adminid, array(1, 2, 3))) { $alloweditpost = $alloweditpoll = $allowstickthread = $allowmodpost = $allowdelpost = $allowmassprune = $allowrefund = $allowcensorword = $allowviewip = $allowbanip = $allowedituser = $allowmoduser = $allowbanuser = $allowpostannounce = $allowviewlog = $disablepostctrl = 0; } elseif(isset($radminid) && $adminid != $radminid && $adminid != $groupid) { $cachelost .= (@include DISCUZ_ROOT.'./forumdata/cache/admingroup_'.intval($adminid).'.php') ? '' : ' admingroup_'.$groupid; } $page = isset($page) ? max(1, intval($page)) : 1; $tid = isset($tid) && is_numeric($tid) ? $tid : 0; $fid = isset($fid) && is_numeric($fid) ? $fid : 0; $typeid = isset($typeid) ? intval($typeid) : 0; $tpp = intval(empty($_DSESSION['tpp']) ? $topicperpage : $_DSESSION['tpp']); $ppp = intval(empty($_DSESSION['ppp']) ? $postperpage : $_DSESSION['ppp']); $modthreadkey = isset($modthreadkey) && $modthreadkey == modthreadkey($tid) ? $modthreadkey : ''; $auditstatuson = $modthreadkey ? true : false; if(!empty($tid) || !empty($fid)) { if(empty($tid)) { $forum = $db->fetch_first("SELECT f.fid, f.*, ff.* $accessadd1 $modadd1, f.fid AS fid FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid $accessadd2 $modadd2 WHERE f.fid='$fid'"); } else { $forum = $db->fetch_first("SELECT t.tid, t.closed,".(defined('SQL_ADD_THREAD') ? SQL_ADD_THREAD : '')." f.*, ff.* $accessadd1 $modadd1, f.fid AS fid FROM {$tablepre}threads t INNER JOIN {$tablepre}forums f ON f.fid=t.fid LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid $accessadd2 $modadd2 WHERE t.tid='$tid'".($auditstatuson ? '' : " AND t.displayorder>='0'")." LIMIT 1"); $tid = $forum['tid']; } if($forum) { $fid = $forum['fid']; $forum['ismoderator'] = !empty($forum['ismoderator']) || $adminid == 1 || $adminid == 2 ? 1 : 0; foreach(array('postcredits', 'replycredits', 'threadtypes', 'threadsorts', 'digestcredits', 'postattachcredits', 'getattachcredits', 'modrecommend') as $key) { $forum[$key] = !empty($forum[$key]) ? unserialize($forum[$key]) : array(); } } else { $fid = 0; } } $styleid = intval(!empty($_GET['styleid']) ? $_GET['styleid'] : (!empty($_POST['styleid']) ? $_POST['styleid'] : (!empty($_DSESSION['styleid']) ? $_DSESSION['styleid'] : $_DCACHE['settings']['styleid']))); $styleid = intval(isset($styles[$styleid]) ? $styleid : $_DCACHE['settings']['styleid']); if(@!include DISCUZ_ROOT.'./forumdata/cache/style_'.intval(!empty($forum['styleid']) ? $forum['styleid'] : $styleid).'.php') { $cachelost .= (@include DISCUZ_ROOT.'./forumdata/cache/style_'.($styleid = $_DCACHE['settings']['styleid']).'.php') ? '' : ' style_'.$styleid; } if($cachelost) { require_once DISCUZ_ROOT.'./include/cache.func.php'; updatecache(); exit('Cache List: '.$cachelost.'<br />Caches successfully created, please refresh.'); } if(CURSCRIPT != 'wap') { if($nocacheheaders) { @dheader("Expires: 0"); @dheader("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); @dheader("Pragma: no-cache"); } if($headercharset) { @dheader('Content-Type: text/html; charset='.$charset); } if(empty($_DCOOKIE['sid']) || $sid != $_DCOOKIE['sid']) { dsetcookie('sid', $sid, 86400, 1, true); } } $_DCOOKIE['loginuser'] = !empty($_DCOOKIE['loginuser']) ? substr(htmlspecialchars($_DCOOKIE['loginuser']), 0, 15) : ''; if($cronnextrun && $cronnextrun <= $timestamp) { require_once DISCUZ_ROOT.'./include/cron.func.php'; runcron(); } if((!empty($_DCACHE['advs']) || $globaladvs) && !defined('IN_ADMINCP')) { require_once DISCUZ_ROOT.'./include/advertisements.inc.php'; } if(isset($plugins['include']) && is_array($plugins['include'])) { foreach($plugins['include'] as $pluginid => $include) { if(!$include['adminid'] || ($include['adminid'] && $adminid > 0 && $include['adminid'] >= $adminid)) { if(@in_array($pluginid, $pluginlangs)) { @include_once DISCUZ_ROOT.'./forumdata/cache/cache_scriptlang.php'; } @include_once DISCUZ_ROOT.'./plugins/'.$include['script'].'.inc.php'; } } } if(isset($allowvisit) && $allowvisit == 0 && !(CURSCRIPT == 'member' && ($action == 'groupexpiry' || $action == 'activate'))) { showmessage('user_banned', NULL, 'HALTED'); } elseif(!(in_array(CURSCRIPT, array('logging', 'wap', 'seccode', 'ajax')) || $adminid == 1)) { if($bbclosed) { clearcookies(); $closedreason = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='closedreason'"); showmessage($closedreason ? $closedreason : 'board_closed', NULL, 'NOPERM'); } periodscheck('visitbanperiods'); } if((!empty($fromuid) || !empty($fromuser)) && ($creditspolicy['promotion_visit'] || $creditspolicy['promotion_register'])) { require_once DISCUZ_ROOT.'/include/promotion.inc.php'; } if($uchome['addfeed']) { $customaddfeed = $customaddfeed == '-1' ? 0 : ($customaddfeed == 0 ? $uchome['addfeed'] : intval($customaddfeed)); } else { $customaddfeed = 0; } $rssauth = $rssstatus && $discuz_uid ? rawurlencode(authcode("$discuz_uid\t".($fid ? $fid : '')."\t".substr(md5($discuz_pw.$discuz_secques), 0, 8), 'ENCODE', md5($_DCACHE['settings']['authkey']))) : '0'; $transferstatus = $transferstatus && $allowtransfer; $feedpostnum = $feedpostnum && $uchomeurl ? intval($feedpostnum) : 0; $pluginhooks = array(); if(isset($hookscript[CURSCRIPT]['module'])) { hookscript(CURSCRIPT); } if($discuz_uid && $newbietaskupdate && $lastactivity < $newbietaskupdate) { require_once DISCUZ_ROOT.'./include/task.func.php'; task_newfunction_autoapply(); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/common.inc.php
PHP
asf20
18,578
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_up.inc.php 16688 2008-11-14 06:41:07Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $getmagicdata = $magicperm['presentcontent']; if(submitcheck('usesubmit')) { foreach($getmagicdata as $getmagicid => $magicdata) { $totalweight = $magicdata['num'] * $magicdata['weight']; getmagic($getmagicid, $magicdata['num'], $magicdata['weight'], $totalweight, $discuz_uid, 0, 1); } usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier']); showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $lang; magicshowtips($lang['NEW_info'], $lang['option']); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_new.inc.php
PHP
asf20
850
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_close.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($tid)) { showmessage('magics_info_nonexistence'); } $thread = getpostinfo($tid, 'tid', array('fid')); checkmagicperm($magicperm['forum'], $thread['fid']); magicthreadmod($tid); $db->query("UPDATE {$tablepre}threads SET closed='1', moderated='1' WHERE tid='$tid'"); $expiration = $timestamp + 86400; usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread_anonymous', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_close.inc.php
PHP
asf20
1,136
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_hidden.inc.php 16688 2008-11-14 06:41:07Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($pid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($pid, 'pid', array('p.tid', 'p.fid', 'p.author', 'p.authorid', 'first', 'p.dateline', 'anonymous')); checkmagicperm($magicperm['forum'], $post['fid']); if($post['authorid'] != $discuz_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'] : ''; $db->query("UPDATE {$tablepre}posts SET anonymous='1' WHERE tid='$post[tid]' AND first='1'"); updatemagicthreadlog($post['tid'], $magicid, $magic['identifier'], '0', '1'); } else { $author = $thread['author']; $lastposter = ''; $db->query("UPDATE {$tablepre}posts SET anonymous='1' WHERE pid='$pid'"); } $query = $db->query("SELECT lastpost FROM {$tablepre}forums WHERE fid='$post[fid]'"); $forum['lastpost'] = explode("\t", $db->result($query, 0)); if($post['dateline'] == $forum['lastpost'][2] && ($post['author'] == $forum['lastpost'][3] || ($forum['lastpost'][3] == '' && $post['anonymous']))) { $lastpost = "$thread[tid]\t$thread[subject]\t$timestamp\t$lastposter"; $db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost' WHERE fid='$post[fid]'", 'UNBUFFERED'); } $db->query("UPDATE {$tablepre}threads SET author='$author', lastposter='$lastposter', moderated='1' WHERE tid='$post[tid]'"); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '0', $pid); showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $pid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_pid'], 'pid', $pid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_hidden.inc.php
PHP
asf20
2,118
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_del.inc.php 19960 2009-09-15 23:18:37Z wangjinbo $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($pid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($pid, 'pid', array('t.tid', 't.fid', 't.authorid', 'first')); checkmagicperm($magicperm['forum'], $post['fid']); if($post['authorid'] != $discuz_uid) { showmessage('magics_operation_nopermission'); } require_once DISCUZ_ROOT.'./include/post.func.php'; if($post['first']) { foreach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'attachments', 'favorites', 'debates', 'debateposts', 'typeoptionvars', 'forumrecommend') as $value) { $db->query("DELETE FROM {$tablepre}$value WHERE tid='$post[tid]'", 'UNBUFFERED'); } $query = $db->query("SELECT uid, attachment, dateline, thumb, remote FROM {$tablepre}attachments WHERE tid='$post[tid]'"); while($attach = $db->fetch_array($query)) { dunlink($attach['attachment'], $attach['thumb'], $attach['remote']); } updateforumcount($post['fid']); } else { $db->query("DELETE FROM {$tablepre}posts WHERE pid='$pid'", 'UNBUFFERED'); $db->query("DELETE FROM {$tablepre}attachments WHERE pid='$pid'", 'UNBUFFERED'); $db->query("DELETE FROM {$tablepre}attachmentfields WHERE pid='$pid'", 'UNBUFFERED'); $query = $db->query("SELECT uid, attachment, dateline, thumb, remote FROM {$tablepre}attachments WHERE pid='$pid'"); while($attach = $db->fetch_array($query)) { dunlink($attach['attachment'], $attach['thumb'], $attach['remote']); } updatethreadcount($post['tid']); } usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '0', $pid); showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $pid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_pid'], 'pid', $pid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_del.inc.php
PHP
asf20
2,160
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_renew.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($pid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($pid, 'pid', array('p.tid', 'p.fid', 'p.authorid', 'first', 'anonymous')); checkmagicperm($magicperm['forum'], $post['fid']); $query = $db->query("SELECT username FROM {$tablepre}members WHERE uid='$post[authorid]'"); $author = daddslashes($db->result($query, 0), 1); $thread = getpostinfo($post['tid'], 'tid', array('tid', 'subject', 'author', 'replies', 'lastposter')); if($post['first']) { $lastposter = $thread['replies'] > 0 ? $thread['lastposter'] : $author; $db->query("UPDATE {$tablepre}posts SET anonymous='0' WHERE tid='$post[tid]' AND first='1'"); updatemagicthreadlog($post['tid'], $magicid, $magic['identifier'], '0', '1'); } else { $lastposter = $author; $author = $thread['author']; $db->query("UPDATE {$tablepre}posts SET anonymous='0' WHERE pid='$pid'"); } $query = $db->query("SELECT lastpost FROM {$tablepre}forums WHERE fid='$post[fid]'"); $forum['lastpost'] = explode("\t", $db->result($query, 0)); if($thread['subject'] == $forum['lastpost'][1] && ($forum['lastpost'][3] == '' && $post['anonymous'])) { $lastpost = "$thread[tid]\t$thread[subject]\t$timestamp\t$lastposter"; $db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost' WHERE fid='$post[fid]'", 'UNBUFFERED'); } $db->query("UPDATE {$tablepre}threads SET author='$author', lastposter='$lastposter', moderated='1' WHERE tid='$post[tid]'"); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '0', $pid); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread_anonymous', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $pid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_pid'], 'pid', $pid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_renew.inc.php
PHP
asf20
2,213
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_open.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($tid)) { showmessage('magics_info_nonexistence'); } $thread = getpostinfo($tid, 'tid', array('fid')); checkmagicperm($magicperm['forum'], $thread['fid']); magicthreadmod($tid); $db->query("UPDATE {$tablepre}threads SET closed='0', moderated='1' WHERE tid='$tid'"); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier']); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_open.inc.php
PHP
asf20
1,076
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_up.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($tid)) { showmessage('magics_info_nonexistence'); } $thread = getpostinfo($tid, 'tid', array('fid')); checkmagicperm($magicperm['forum'], $thread['fid']); $db->query("UPDATE {$tablepre}threads SET lastpost='$timestamp', moderated='1' WHERE tid='$tid'"); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier']); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_up.inc.php
PHP
asf20
1,061
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_reporter.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($username)) { showmessage('magics_info_nonexistence'); } $member = getuserinfo($username, array('uid', 'groupid')); checkmagicperm($magicperm['targetgroups'], $member['groupid']); $query = $db->query("SELECT action FROM {$tablepre}sessions WHERE uid='$member[uid]'"); if(!$msession = $db->fetch_array($query)) { $magicmessage = 'magics_RTK_on_message'; } else { include language('actions'); $magicmessage = 'magics_RTK_off_message'; } usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '', '', $member['uid']); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_user_anonymous', 'systempm'); } showmessage($magicmessage, '', 1); } function showmagic() { global $username, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_username'], 'username', $username, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_reporter.inc.php
PHP
asf20
1,234
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_see.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($pid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($pid, 'pid', array('p.fid', 'useip')); checkmagicperm($magicperm['forum'], $post['fid']); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '0', $pid); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_user_anonymous', 'systempm'); } showmessage('magics_SEK_message', '', 1); } function showmagic() { global $pid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_pid'], 'pid', $pid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_see.inc.php
PHP
asf20
911
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_money.inc.php 16688 2008-11-14 06:41:07Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { $getmoney = rand(1, intval($magic['price'] * 1.5)); $db->query("UPDATE {$tablepre}members SET extcredits$creditstransextra[3]=extcredits$creditstransextra[3]+'$getmoney' WHERE uid='$discuz_uid'"); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '', '', $discuz_uid); showmessage('magics_MOK_message', '', 1); } function showmagic() { global $lang; magicshowtips($lang['MOK_info'], $lang['option']); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_money.inc.php
PHP
asf20
731
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_color.inc.php 19908 2009-09-14 13:14:41Z liuqiang $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($highlight_color)) { showmessage('magics_info_nonexistence'); } $thread = getpostinfo($tid, 'tid', array('fid', 'authorid', 'subject')); checkmagicperm($magicperm['forum'], $thread['fid']); magicthreadmod($tid); $db->query("UPDATE {$tablepre}threads SET highlight='$highlight_color', moderated='1' WHERE tid='$tid'", 'UNBUFFERED'); $expiration = $timestamp + 86400; usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; echo <<<EOT <table cellspacing="0" cellpadding="2" style="margin-top:-20px;"> <tr> <td>$lang[target_tid]</td> <td>$lang[CCK_color]</td> </tr> <tr> <td><input type="text" value="$tid" name="tid" size="12" class="txt" /></td> <td class="hasdropdownbtn" style="position: relative;"> <input type="hidden" id="highlight_color" name="highlight_color" /> <input type="text" readonly="readonly" class="txt" id="highlight_color_show" style="width: 18px; border-right: none;" /> <a href="javascript:;" id="highlight_color_ctrl" class="dropdownbtn" onclick="showHighLightColor('highlight_color')">^</a> </td> </tr> </table> <script type="text/javascript" reload="1"> function showHighLightColor(hlid) { var showid = hlid + '_show'; if(!$(showid + '_menu')) { var str = ''; var coloroptions = {'0' : '#000', '1' : '#EE1B2E', '2' : '#EE5023', '3' : '#996600', '4' : '#3C9D40', '5' : '#2897C5', '6' : '#2B65B7', '7' : '#8F2A90', '8' : '#EC1282'}; var menu = document.createElement('div'); menu.id = showid + '_menu'; menu.className = 'color_menu'; menu.style.display = 'none'; for(var i in coloroptions) { str += '<a href="javascript:;" onclick="$(\'' + hlid + '\').value=' + i + ';$(\'' + showid + '\').style.backgroundColor=\'' + coloroptions[i] + '\';hideMenu(\'' + menu.id + '\')" style="background:' + coloroptions[i] + ';color:' + coloroptions[i] + ';">' + coloroptions[i] + '</a>'; } menu.innerHTML = str; $('append_parent').appendChild(menu); } showMenu({'ctrlid':hlid + '_ctrl','evt':'click','showid':showid}); } </script> EOT; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_color.inc.php
PHP
asf20
2,724
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_move.inc.php 16688 2008-11-14 06:41:07Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($tid) && empty($moveto)) { showmessage('magics_info_nonexistence'); } $thread = getpostinfo($tid, 'tid', array('fid', 'tid', 'authorid', 'special')); checkmagicperm($magicperm['forum'], $thread['fid']); if($thread['authorid'] != $discuz_uid) { showmessage('magics_operation_nopermission'); } if($thread['special']) { $query = $db->query("SELECT allowpostspecial FROM {$tablepre}forums WHERE fid='$moveto'"); if(!substr(sprintf('%04b', $forum['allowpostspecial']), -$thread['special'], 1)) { showmessage('admin_move_nopermission'); } } $query = $db->query("SELECT postperm FROM {$tablepre}forumfields WHERE fid='$moveto'"); if($forum = $db->fetch_array($query)) { if(!$forum['postperm'] && !$allowpost) { showmessage('group_nopermission'); } elseif($forum['postperm'] && !forumperm($forum['postperm'])) { showmessage('post_forum_newthread_nopermission'); } } $db->query("UPDATE {$tablepre}threads SET fid='$moveto', moderated='1' WHERE tid='$tid'"); $db->query("UPDATE {$tablepre}posts SET fid='$moveto' WHERE tid='$tid'"); require_once DISCUZ_ROOT.'./include/post.func.php'; updateforumcount($moveto); updateforumcount($thread['fid']); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier']); showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; require_once DISCUZ_ROOT.'./include/forum.func.php'; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowsetting($lang['MVK_target'], '', '', '<select name="moveto">'.forumselect().'</select>'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_move.inc.php
PHP
asf20
2,050
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_top.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($tid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($tid, 'tid', array('fid')); checkmagicperm($magicperm['forum'], $post['fid']); magicthreadmod($tid); $db->query("UPDATE {$tablepre}threads SET displayorder='1', moderated='1' WHERE tid='$tid'"); $expiration = $timestamp + 86400; usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration); if($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_top.inc.php
PHP
asf20
1,126
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: magic_top.inc.php 19071 2009-08-12 03:22:17Z tiger $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(submitcheck('usesubmit')) { if(empty($tid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($tid, 'tid', array('fid', 'dateline')); checkmagicperm($magicperm['forum'], $post['fid']); $firstsofa = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threadsmod WHERE magicid='$magicid' AND tid='$tid'"); if($firstsofa >= 1) { showmessage('magics_SOFA_message', '', 1); } $sofamessage = $lang['SOFA_message']; $dateline = $post['dateline'] + 1; $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, dateline, message, useip, usesig) VALUES ('$post[fid]', '$tid', '0', '$discuz_user', '$discuz_uid', '$dateline', '$sofamessage', '$onlineip', '1')"); $db->query("UPDATE {$tablepre}threads SET replies=replies+1, moderated='1' WHERE tid='$tid'", 'UNBUFFERED'); $db->query("UPDATE {$tablepre}forums SET posts=posts+1, todayposts=todayposts+1 WHERE fid='$post[fid]'", 'UNBUFFERED'); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration); if($thread['authorid'] != $discuz_uid) { sendpm($thread['authorid'], 'magics_use_subject', 'magic_thread', 0); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'hidden'); magicshowtype('', 'bottom'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/include/magic/magic_sofa.inc.php
PHP
asf20
1,736
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: image.php 20757 2009-10-19 01:50:23Z monkey $ */ error_reporting(0); if(empty($_GET['aid']) || empty($_GET['size']) || empty($_GET['key'])) { exit; } $nocache = !empty($_GET['nocache']) ? 1 : 0; $aid = intval($_GET['aid']); list($w, $h) = explode('x', $_GET['size']); $w = intval($w); $h = intval($h); $thumbfile = ''; if(!$nocache) { $thumbfile = 'forumdata/imagecaches/'.$aid.'_'.$w.'_'.$h.'.jpg'; if(file_exists($thumbfile)) { $PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $boardurl = htmlspecialchars('http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api|archiver|wap)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/'); header('location: '.$boardurl.$thumbfile); exit; } } define('CURSCRIPT', 'image'); define('NOROBOT', TRUE); require_once './include/common.inc.php'; list($daid, $dw, $dh) = explode("\t", authcode($_GET['key'], 'DECODE', $_DCACHE['settings']['authkey'])); if($daid != $aid || $dw != $w || $dh != $h) { dheader('location: '.$boardurl.'images/common/none.gif'); } if($attach = $db->fetch_array($db->query("SELECT remote, attachment FROM {$tablepre}attachments WHERE aid='$aid' AND isimage IN ('1', '-1')"))) { if($attach['remote']) { $filename = $ftp['attachurl'].'/'.$attach['attachment']; } else { $filename = $attachdir.'/'.$attach['attachment']; } $img = new Image_Lite($filename, !$nocache ? $thumbfile : ''); if($img->attachinfo === FALSE || $img->Thumb($w, $h) && !$nocache) { dheader('location: '.($thumbfile ? $boardurl.$thumbfile : $filename)); } @readfile($filename); } class Image_Lite { var $attachinfo = ''; var $srcfile = ''; var $targetfile = ''; var $imagecreatefromfunc = ''; var $imagefunc = ''; var $attach = array(); var $animatedgif = 0; var $smallimg = 0; var $img_w = 0; var $img_h = 0; var $thumbwidth = 0; var $thumbheight = 0; function Image_Lite($srcfile, $targetfile) { $this->srcfile = $srcfile; $this->targetfile = $targetfile ? $targetfile : ''; $this->attachinfo = @getimagesize($srcfile); list($this->img_w, $this->img_h) = $this->attachinfo; if($targetfile) { @mkdir(DISCUZ_ROOT.'./forumdata/imagecaches/', 0777); } } function Thumb($thumbwidth, $thumbheight) { global $imagelib, $imageimpath; $this->thumbwidth = $thumbwidth; $this->thumbheight = $thumbheight; $this->smallimg = $this->img_w < $this->thumbwidth || $this->img_h < $this->thumbheight; return $imagelib && $imageimpath && $this->targetfile && !$this->smallimg ? $this->Thumb_IM() : $this->Thumb_GD(); } function Size() { $imgratio = $this->img_w / $this->img_h; $thumbratio = $this->thumbwidth / $this->thumbheight; if($imgratio >= 1 && $imgratio >= $thumbratio || $imgratio < 1 && $imgratio > $thumbratio) { $cuth = $this->img_h; $cutw = $cuth * $thumbratio; $startx = ($this->img_w - $thumbratio * $this->img_h) / 2; $starty = 0; } elseif($imgratio >= 1 && $imgratio <= $thumbratio || $imgratio < 1 && $imgratio < $thumbratio) { $cutw = $this->img_w; $cuth = $cutw / $thumbratio; $startx = 0; $starty = 0; } return array($cutw, $cuth, $startx, $starty); } function Thumb_GD() { switch($this->attachinfo['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; } if($this->attachinfo['mime'] == 'image/gif') { $fp = fopen($this->srcfile, 'rb'); $targetfilecontent = fread($fp, @filesize($this->srcfile)); fclose($fp); $this->animatedgif = strpos($targetfilecontent, 'NETSCAPE2.0') === FALSE ? 0 : 1; } if(function_exists('imagecreatetruecolor') && function_exists('imagecopymerge') && function_exists('imagecopyresampled') && function_exists($this->imagecreatefromfunc) && function_exists($this->imagefunc)) { $imagecreatefromfunc = $this->imagecreatefromfunc; $imagefunc = $this->imagefunc; if(!$this->animatedgif) { $attach_photo = @$imagecreatefromfunc($this->srcfile); if($attach_photo) { if(!$this->smallimg) { list($cutw, $cuth, $startx, $starty) = $this->size(); $dst_photo = imagecreatetruecolor($cutw, $cuth); imagecopymerge($dst_photo, $attach_photo, 0, 0, $startx, $starty, $cutw, $cuth, 100); $thumb_photo = imagecreatetruecolor($this->thumbwidth, $this->thumbheight); imagecopyresampled($thumb_photo, $dst_photo ,0, 0, 0, 0, $this->thumbwidth, $this->thumbheight, $cutw, $cuth); } else { $bgcolor = imagecolorat($attach_photo, 0, 0); $bgcolor = imagecolorsforindex($attach_photo, $bgcolor); $thumb_photo = imagecreatetruecolor($this->thumbwidth, $this->thumbheight); $bgcolor = imagecolorallocate($thumb_photo, $bgcolor['red'], $bgcolor['green'], $bgcolor['blue']); imagefill($thumb_photo, 0, 0, $bgcolor); imagecopymerge($thumb_photo, $attach_photo, ($this->thumbwidth - $this->img_w) / 2, ($this->thumbheight - $this->img_h) / 2, 0, 0, $this->img_w, $this->img_h, 100); } clearstatcache(); $targetfile = $this->targetfile ? DISCUZ_ROOT.$this->targetfile : ''; if($this->attachinfo['mime'] == 'image/jpeg') { $imagefunc($thumb_photo, $targetfile, 100); } elseif($targetfile) { $imagefunc($thumb_photo, $targetfile); } else { $imagefunc($thumb_photo); } return TRUE; } } } return FALSE; } function Thumb_IM() { list($cutw, $cuth, $startx, $starty) = $this->size(); global $imageimpath; $exec_str = $imageimpath.'/convert -crop '.$cutw.'x'.$cuth.'+'.$startx.'+'.$starty.' '.$this->srcfile.' '.$this->targetfile; @exec($exec_str); $exec_str = $imageimpath.'/convert -quality 100 -geometry '.$this->thumbwidth.'x'.$this->thumbheight.' '.$this->targetfile.' '.$this->targetfile; @exec($exec_str); if(file_exists(DISCUZ_ROOT.$this->targetfile)) { dheader('location: '.$GLOBALS['boardurl'].$this->targetfile); } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/image.php
PHP
asf20
6,684
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: forumdisplay.php 21337 2010-01-06 08:09:58Z tiger $ */ define('BINDDOMAIN', 'forumdisplay'); require_once './include/common.inc.php'; require_once DISCUZ_ROOT.'./include/forum.func.php'; $discuz_action = 2; if($forum['redirect']) { dheader("Location: $forum[redirect]"); } elseif($forum['type'] == 'group') { dheader("Location: {$indexname}?gid=$fid"); } elseif(empty($forum['fid'])) { header("HTTP/1.0 404 Not Found"); showmessage('forum_nonexistence', NULL, 'HALTED'); } $showoldetails = isset($showoldetails) ? $showoldetails : ''; switch($showoldetails) { case 'no': dsetcookie('onlineforum', 0, 86400 * 365); break; case 'yes': dsetcookie('onlineforum', 1, 86400 * 365); break; } $forum['name'] = strip_tags($forum['name']) ? strip_tags($forum['name']) : $forum['name']; $forum['extra'] = unserialize($forum['extra']); if(!is_array($forum['extra'])) { $forum['extra'] = array(); } if($forum['type'] == 'forum') { $navigation = '&raquo; '.$forum['name']; $navtitle = $forum['name']; } else { $forumup = $_DCACHE['forums'][$forum['fup']]['name']; $navigation = '&raquo; <a href="forumdisplay.php?fid='.$forum['fup'].'">'.$forumup.'</a> &raquo; '.$forum['name']; $navtitle = $forum['name'].' - '.strip_tags($forumup); } $rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.' - '.$navtitle.'" href="'.$boardurl.'rss.php?fid='.$fid.'&amp;auth='.$rssauth."\" />\n") : ''; $navtitle .= ' - '; $metakeywords = !$forum['keywords'] ? $forum['name'] : $forum['keywords']; $metadescription = !$forum['description'] ? $forum['name'] : strip_tags($forum['description']); if($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) { showmessagenoperm('viewperm', $fid); } elseif ($forum['formulaperm'] && $adminid != 1) { formulaperm($forum['formulaperm']); } if($forum['password']) { if($action == 'pwverify') { if($pw != $forum['password']) { showmessage('forum_passwd_incorrect', NULL, 'HALTED'); } else { dsetcookie('fidpw'.$fid, $pw); showmessage('forum_passwd_correct', "forumdisplay.php?fid=$fid"); } } elseif($forum['password'] != $_DCOOKIE['fidpw'.$fid]) { include template('forumdisplay_passwd'); exit(); } } $sdb = loadmultiserver(); foreach(array('modarea_c', 'sidebar') as $key) { if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], $key) === FALSE) { $collapseimg[$key] = 'collapsed_no'; $collapse[$key] = ''; } else { $collapseimg[$key] = 'collapsed_yes'; $collapse[$key] = 'display: none'; } } if($forum['modrecommend'] && $forum['modrecommend']['open']) { $forum['recommendlist'] = recommendupdate($fid, $forum['modrecommend'], '', 1); } if($forum['modworks']) { $reportnum = $allowviewreport ? $db->result_first("SELECT COUNT(*) FROM {$tablepre}reportlog WHERE fid='$fid' AND status='1'") : 0; $modnum = $allowmodpost ? ($db->result_first("SELECT COUNT(*) FROM {$tablepre}posts WHERE invisible='-2' AND first='0' and fid='$fid'") + $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE fid='$fid' AND displayorder='-2'")) : 0; $modusernum = $allowmoduser ? $db->result_first("SELECT COUNT(*) FROM {$tablepre}validating WHERE status='0'") : 0; } $toptablewidth = $forum['rules'] && $forum['recommendlist'] ? '50%' : '100%'; $infosidestatus[0] = !empty($infosidestatus['f'.$fid][0]) ? $infosidestatus['f'.$fid][0] : $infosidestatus[0]; $infosidestatus['allow'] = $infosidestatus['allow'] && $infosidestatus[0] && $infosidestatus[0] != -1 ? (!$collapse['sidebar'] ? 2 : 1) : 0; $forum['typemodels'] = $forum['typemodels'] ? unserialize($forum['typemodels']) : array(); $optionadd = $filterurladd = ''; $threadids = array(); if($forum['threadsorts']['defaultshow'] && $forum['threadsorts']['types'] && empty($sortid)) { $sortid = $forum['threadsorts']['defaultshow']; $filterurladd = '&amp;filter=sort'; } if($sortid && $forum['threadsorts']['types'][$sortid]) { $sortid = intval($sortid); include_once DISCUZ_ROOT.'./forumdata/cache/threadsort_'.$sortid.'.php'; require_once DISCUZ_ROOT.'./include/forumsort.func.php'; $quicksearchlist = quicksearch(); } $moderatedby = moddisplay($forum['moderators'], 'forumdisplay'); $highlight = empty($highlight) ? '' : htmlspecialchars($highlight); if($forum['autoclose']) { $closedby = $forum['autoclose'] > 0 ? 'dateline' : 'lastpost'; $forum['autoclose'] = abs($forum['autoclose']) * 86400; } $subexists = 0; foreach($_DCACHE['forums'] as $sub) { if($sub['type'] == 'sub' && $sub['fup'] == $fid && (!$hideprivate || !$sub['viewperm'] || forumperm($sub['viewperm']) || strstr($sub['users'], "\t$discuz_uid\t"))) { if(!$sub['status']) { continue; } $subexists = 1; $sublist = array(); $sql = $accessmasks ? "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.extra, a.allowview FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid WHERE fup='$fid' AND status>'0' AND type='sub' ORDER BY f.displayorder" : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.extra FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff USING(fid) WHERE f.fup='$fid' AND f.status>'0' AND f.type='sub' ORDER BY f.displayorder"; $query = $sdb->query($sql); while($sub = $sdb->fetch_array($query)) { $sub['extra'] = unserialize($sub['extra']); if(!is_array($sub['extra'])) { $sub['extra'] = array(); } if(forum($sub)) { $sub['orderid'] = count($sublist); $sublist[] = $sub; } } break; } } if($subexists) { if($forum['forumcolumns']) { $forum['forumcolwidth'] = floor(100 / $forum['forumcolumns']).'%'; $forum['subscount'] = count($sublist); $forum['endrows'] = ''; if($colspan = $forum['subscount'] % $forum['forumcolumns']) { while(($forum['forumcolumns'] - $colspan) > 0) { $forum['endrows'] .= '<td>&nbsp;</td>'; $colspan ++; } $forum['endrows'] .= '</tr>'; } } if(empty($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'subforum_'.$fid) === FALSE) { $collapse['subforum'] = ''; $collapseimg['subforum'] = 'collapsed_no.gif'; } else { $collapse['subforum'] = 'display: none'; $collapseimg['subforum'] = 'collapsed_yes.gif'; } } if($forum['simple'] & 1) { $forummenu = ''; if($forumjump) { $forummenu = forumselect(FALSE, 1); } include template('forumdisplay_simple'); exit(); } $page = isset($page) ? max(1, intval($page)) : 1; $page = $threadmaxpages && $page > $threadmaxpages ? 1 : $page; $start_limit = ($page - 1) * $tpp; if($page == 1) { if($_DCACHE['announcements_forum']) { $announcement = $_DCACHE['announcements_forum']; $announcement['starttime'] = gmdate($dateformat, $announcement['starttime'] + ($timeoffset * 3600)); } else { $announcement = NULL; } } $forumdisplayadd = $filteradd = $sortadd = $typeadd = $sorturladd = ''; $sorturladd = $selectadd = array(); $specialtype = array('poll' => 1, 'trade' => 2, 'reward' => 3, 'activity' => 4, 'debate' => 5); isset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views', 'recommends', 'heats')) ? $forumdisplayadd .= "&amp;orderby=$orderby" : $orderby = $_DCACHE['forums'][$fid]['orderby'] ? $_DCACHE['forums'][$fid]['orderby'] : 'lastpost'; isset($ascdesc) && in_array($ascdesc, array('ASC', 'DESC')) ? $forumdisplayadd .= "&amp;ascdesc=$ascdesc" : $ascdesc = $_DCACHE['forums'][$fid]['ascdesc'] ? $_DCACHE['forums'][$fid]['ascdesc'] : 'DESC'; if(isset($filter)) { if($filter == 'digest') { $forumdisplayadd .= '&amp;filter=digest'; $filteradd = "AND digest>'0'"; } elseif($recommendthread['status'] && $filter == 'recommend') { $forumdisplayadd .= '&amp;filter=recommend'; $filteradd = "AND recommends>'".intval($recommendthread['iconlevels'][0])."'"; } elseif($filter == 'type' && $forum['threadtypes']['listable'] && $typeid && isset($forum['threadtypes']['types'][$typeid])) { $forumdisplayadd .= "&amp;filter=type&amp;typeid=$typeid"; $typeadd = "&amp;typeid=$typeid"; $filteradd = "AND typeid='$typeid'"; if($sortid) { $filteradd .= "AND sortid='$sortid'"; $forumdisplayadd .= $sortadd = "&amp;sortid=$sortid"; } } elseif($filter == 'sort' && $sortid && isset($forum['threadsorts']['types'][$sortid])) { $forumdisplayadd .= "&amp;filter=sort&amp;sortid=$sortid"; $sortadd = "&amp;sortid=$sortid"; $filteradd = "AND sortid='$sortid'"; if($typeid) { $filteradd .= "AND typeid='$typeid'"; $forumdisplayadd .= $typeadd = "&amp;typeid=$typeid"; } $query_string = daddslashes($_SERVER['QUERY_STRING'], 1); if($query_string && $quicksearchlist['option']) { $query_string = substr($query_string, (strpos($query_string, "&") + 1)); parse_str($query_string, $selectadd); if($selectadd && is_array($selectadd)) { $and = ''; foreach($quicksearchlist['option'] as $option) { $identifier = $option['identifier']; foreach($selectadd as $option => $value) { $sorturladd[$identifier] .= !in_array($option, array('filter', 'sortid', $identifier)) ? "$and$option=$value" : ''; $and = '&'; } } } } } elseif($filter == 'special' && array_key_exists($extraid, $threadplugins)) { $forumdisplayadd .= "&amp;filter=special&amp;extraid=$extraid"; $filteradd = "AND iconid='{$threadplugins[$extraid][iconid]}'"; } elseif(preg_match("/^\d+$/", $filter)) { $forumdisplayadd .= "&amp;filter=$filter"; $filteradd = $filter ? "AND lastpost>='".($timestamp - $filter)."'" : ''; $orderby = $orderby != 'recommends' ? $orderby : 'heats'; } elseif(isset($specialtype[$filter])) { $forumdisplayadd .= "&amp;filter=$filter"; $filteradd = "AND special='$specialtype[$filter]'"; } elseif($orderby == 'lastpost') { $filter = ''; } else { $filter = 2592000; $forumdisplayadd .= "&amp;filter=2592000"; $filteradd = "AND lastpost>='".($timestamp - 2592000)."'"; } } else { $filter = ''; } $check = array(); $check[$filter] = $check[$orderby] = $check[$ascdesc] = 'selected="selected"'; if($whosonlinestatus == 2 || $whosonlinestatus == 3) { $whosonlinestatus = 1; $onlineinfo = explode("\t", $onlinerecord); $detailstatus = $showoldetails == 'yes' || (((!isset($_DCOOKIE['onlineforum']) && !$whosonline_contract) || $_DCOOKIE['onlineforum']) && $onlineinfo[0] < 500 && !$showoldetails); if($detailstatus) { updatesession(); @include language('actions'); $whosonline = array(); $forumname = strip_tags($forum['name']); $guestwhere = isset($_DCACHE['onlinelist'][7]) ? '' : "uid>'0' AND"; $query = $db->query("SELECT uid, groupid, username, invisible, lastactivity, action FROM {$tablepre}sessions WHERE $guestwhere fid='$fid' AND invisible='0'"); if($db->num_rows($query)) { $whosonlinestatus = 1; while($online = $db->fetch_array($query)) { if($online['uid']) { $online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0]; } else { $online['icon'] = $_DCACHE['onlinelist'][7]; $online['username'] = $_DCACHE['onlinelist']['guest']; } $online['action'] = $actioncode[$online['action']]; $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600)); $whosonline[] = $online; } } unset($online); } } else { $whosonlinestatus = 0; } if(empty($filter) && empty($sortid)) { $threadcount = $forum['threads']; } else { $threadcount = $sdb->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE fid='$fid' $filteradd AND displayorder>='0'"); } $thisgid = $forum['type'] == 'forum' ? $forum['fup'] : $_DCACHE['forums'][$forum['fup']]['fup']; if($globalstick && $forum['allowglobalstick']) { $stickytids = $_DCACHE['globalstick']['global']['tids'].(empty($_DCACHE['globalstick']['categories'][$thisgid]['count']) ? '' : ','.$_DCACHE['globalstick']['categories'][$thisgid]['tids']); $forumstickytids = array(); $_DCACHE['forumstick'][$fid] = is_array($_DCACHE['forumstick'][$fid]) ? $_DCACHE['forumstick'][$fid] : array(); $forumstickycount = count($_DCACHE['forumstick'][$fid]); foreach($_DCACHE['forumstick'][$fid] as $forumstickthread) { $forumstickytids[] = $forumstickthread['tid']; } if(!empty($forumstickytids)) { $forumstickytids = implodeids($forumstickytids); $stickytids .= ", $forumstickytids"; } $stickytids = trim($stickytids, ', '); if ($stickytids === ''){ $stickytids = '0'; } $stickycount = $_DCACHE['globalstick']['global']['count'] + $_DCACHE['globalstick']['categories'][$thisgid]['count'] + $forumstickycount; } else { $forumstickycount = $stickycount = $stickytids = 0; } $filterbool = !empty($filter) && in_array($filter, array('digest', 'recommend', 'type', 'activity', 'poll', 'trade', 'reward', 'debate')); $threadcount += $filterbool ? 0 : $stickycount; $multipage = multi($threadcount, $tpp, $page, "forumdisplay.php?fid=$fid$forumdisplayadd", $threadmaxpages); $extra = rawurlencode("page=$page$forumdisplayadd"); $separatepos = 0; $threadlist = $threadids = array(); $colorarray = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); $displayorderadd = !$filterbool && $stickycount ? 't.displayorder IN (0, 1)' : 't.displayorder IN (0, 1, 2, 3, 4)'; if(($start_limit && $start_limit > $stickycount) || !$stickycount || $filterbool) { $querysticky = ''; $query = $sdb->query("SELECT t.* FROM {$tablepre}threads t WHERE t.fid='$fid' $filteradd AND $displayorderadd ORDER BY t.displayorder DESC, t.$orderby $ascdesc LIMIT ".($filterbool ? $start_limit : $start_limit - $stickycount).", $tpp"); } else { $querysticky = $sdb->query("SELECT t.* FROM {$tablepre}threads t WHERE t.tid IN ($stickytids) AND t.displayorder IN (2, 3, 4) ORDER BY displayorder DESC, $orderby $ascdesc LIMIT $start_limit, ".($stickycount - $start_limit < $tpp ? $stickycount - $start_limit : $tpp)); if($tpp - $stickycount + $start_limit > 0) { $query = $sdb->query("SELECT t.* FROM {$tablepre}threads t WHERE t.fid='$fid' $filteradd AND $displayorderadd ORDER BY displayorder DESC, $orderby $ascdesc LIMIT ".($tpp - $stickycount + $start_limit)); } else { $query = ''; } } $ppp = $forum['threadcaches'] && !$discuz_uid ? $_DCACHE['settings']['postperpage'] : $ppp; while(($querysticky && $thread = $sdb->fetch_array($querysticky)) || ($query && $thread = $sdb->fetch_array($query))) { if($thread['special'] != 127) { $thread['icon'] = isset($_DCACHE['icons'][$thread['iconid']]) ? '<img src="images/icons/'.$_DCACHE['icons'][$thread['iconid']].'" class="icon" />' : '&nbsp;'; } else { $thread['icon'] = '<a href="forumdisplay.php?fid='.$fid.'&amp;filter=special&extraid='.$specialicon[$thread['iconid']].'"><img src="'.$threadplugins[$specialicon[$thread['iconid']]]['icon'].'" alt="'.$threadplugins[$specialicon[$thread['iconid']]]['name'].'" class="icon" /></a>'; } $thread['lastposterenc'] = rawurlencode($thread['lastposter']); $thread['typeid'] = $thread['typeid'] && !empty($forum['threadtypes']['prefix']) && isset($forum['threadtypes']['types'][$thread['typeid']]) ? '<em>[<a href="forumdisplay.php?fid='.$fid.'&amp;filter=type&amp;typeid='.$thread['typeid'].'">'.$forum['threadtypes']['types'][$thread['typeid']].'</a>]</em>' : ''; $thread['sortid'] = $thread['sortid'] && !empty($forum['threadsorts']['prefix']) && isset($forum['threadsorts']['types'][$thread['sortid']]) ? '<em>[<a href="forumdisplay.php?fid='.$fid.'&amp;filter=sort&amp;sortid='.$thread['sortid'].'">'.$forum['threadsorts']['types'][$thread['sortid']].'</a>]</em>' : ''; $thread['multipage'] = ''; $topicposts = $thread['special'] ? $thread['replies'] : $thread['replies'] + 1; $thread['special'] == 3 && $thread['price'] < 0 && $thread['replies']--; if($topicposts > $ppp) { $pagelinks = ''; $thread['pages'] = ceil($topicposts / $ppp); for($i = 2; $i <= 6 && $i <= $thread['pages']; $i++) { $pagelinks .= "<a href=\"viewthread.php?tid=$thread[tid]&amp;extra=$extra&amp;page=$i\">$i</a>"; } if($thread['pages'] > 6) { $pagelinks .= "..<a href=\"viewthread.php?tid=$thread[tid]&amp;extra=$extra&amp;page=$thread[pages]\">$thread[pages]</a>"; } $thread['multipage'] = '&nbsp;...'.$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: '.$colorarray[$string[1]] : ''; $thread['highlight'] .= '"'; } else { $thread['highlight'] = ''; } if($recommendthread['status'] && $thread['recommends']) { foreach($recommendthread['iconlevels'] as $k => $i) { if($thread['recommends'] > $i) { $thread['recommendicon'] = $k+1; break; } } } else { $thread['recommendicon'] = ''; } $thread['moved'] = $thread['heatlevel'] = 0; if($thread['closed'] || ($forum['autoclose'] && $timestamp - $thread[$closedby] > $forum['autoclose'])) { $thread['new'] = 0; if($thread['closed'] > 1) { $thread['moved'] = $thread['tid']; $thread['tid'] = $thread['closed']; $thread['replies'] = '-'; $thread['views'] = '-'; } $thread['folder'] = 'lock'; } else { $thread['folder'] = 'common'; if($lastvisit < $thread['lastpost'] && (empty($_DCOOKIE['oldtopics']) || strpos($_DCOOKIE['oldtopics'], 'D'.$thread['tid'].'D') === FALSE)) { $thread['new'] = 1; $thread['folder'] = 'new'; } else { $thread['new'] = 0; } if($thread['replies'] > $thread['views']) { $thread['views'] = $thread['replies']; } if($heatthread['iconlevels']) { foreach($heatthread['iconlevels'] as $k => $i) { if($thread['heats'] > $i) { $thread['heatlevel'] = $k + 1; break; } } } } $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600); $thread['lastpost'] = dgmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600); if(in_array($thread['displayorder'], array(1, 2, 3, 4))) { $thread['id'] = 'stickthread_'.$thread['tid']; $separatepos++; } else { $thread['id'] = 'normalthread_'.$thread['tid']; } $threadids[] = $thread['tid']; $threadlist[] = $thread; } if($sortid && $forum['threadsorts']['types'][$sortid]) { $sortlistarray = sortshowlist($searchoid, $searchvid, $threadids, $searchoption, $selectadd); $stemplate = $sortlistarray['stemplate'] ? $sortlistarray['stemplate'] : ''; $threadlist = $sortlistarray['thread']['list'] ? $sortlistarray['thread']['list'] : $threadlist; $threadcount = !empty($sortlistarray['thread']['count']) ? $sortlistarray['thread']['count'] : $threadcount; $multipage = $sortlistarray['thread']['multipage'] ? $sortlistarray['thread']['multipage'] : $multipage; $sortthreadlist = $sortlistarray['sortthreadlist'] ? $sortlistarray['sortthreadlist'] : array(); } $separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0); $visitedforums = $visitedforums ? visitedforums() : ''; $forummenu = ''; $usesigcheck = $discuz_uid && $sigstatus ? 'checked="checked"' : ''; $allowpost = (!$forum['postperm'] && $allowpost) || ($forum['postperm'] && forumperm($forum['postperm'])) || ($forum['allowpost'] == 1 && $allowpost); $fastpost = $fastpost && !$forum['allowspecialonly']; $allowpost = $forum['allowpost'] != -1 ? $allowpost : false; $addfeedcheck = $customaddfeed & 1 ? 'checked="checked"': ''; $showpoll = $showtrade = $showreward = $showactivity = $showdebate = 0; if($forum['allowpostspecial']) { $showpoll = $forum['allowpostspecial'] & 1; $showtrade = $forum['allowpostspecial'] & 2; $showreward = isset($extcredits[$creditstransextra[2]]) && ($forum['allowpostspecial'] & 4); $showactivity = $forum['allowpostspecial'] & 8; $showdebate = $forum['allowpostspecial'] & 16; } if($allowpost) { $allowpostpoll = $allowpostpoll && $showpoll; $allowposttrade = $allowposttrade && $showtrade; $allowpostreward = $allowpostreward && $showreward; $allowpostactivity = $allowpostactivity && $showactivity; $allowpostdebate = $allowpostdebate && $showdebate; } $forum['threadplugin'] = $allowpost && $threadplugins ? unserialize($forum['threadplugin']) : array(); if($forumjump) { $forummenu = forumselect(FALSE, 1); } $template = $sortid ? 'forumdisplay_sort' : 'forumdisplay'; include template($template); ?>
zyyhong
trunk/jiaju001/newbbs/bbs/forumdisplay.php
PHP
asf20
21,332
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: mail.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); class mailcontrol extends base { function __construct() { $this->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); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/mail.php
PHP
asf20
993
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: pm.php 836 2008-12-05 02:25:48Z monkey $ */ !defined('IN_UC') && exit('Access Denied'); define('PMLIMIT1DAY_ERROR', -1); define('PMFLOODCTRL_ERROR', -2); define('PMMSGTONOTFRIEND', -3); define('PMSENDREGDAYS', -4); class pmcontrol extends base { function __construct() { $this->pmcontrol(); } function pmcontrol() { parent::__construct(); $this->load('user'); $this->load('pm'); } function oncheck_newpm() { $this->init_input(); $this->user['uid'] = intval($this->input('uid')); $more = $this->input('more'); $result = $_ENV['pm']->check_newpm($this->user['uid'], $more); if($more == 3) { require_once UC_ROOT.'lib/uccode.class.php'; $this->uccode = new uccode(); $result['lastmsg'] = $this->uccode->complie($result['lastmsg']); } return $result; } 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'); if($fromuid) { $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']; } else { $this->user['uid'] = 0; $this->user['username'] = ''; } if($replypmid) { $isusername = 1; $pms = $_ENV['pm']->get_pm_by_pmid($this->user['uid'], $replypmid); if($pms[0]['msgfromid'] == $this->user['uid']) { $user = $_ENV['user']->get_user_by_uid($pms[0]['msgtoid']); $msgto = $user['username']; } else { $msgto = $pms[0]['msgfrom']; } } $msgto = array_unique(explode(',', $msgto)); $isusername && $msgto = $_ENV['user']->name2id($msgto); $blackls = $_ENV['pm']->get_blackls($this->user['uid'], $msgto); if($fromuid) { if($this->settings['pmsendregdays']) { if($user['regdate'] > $this->time - $this->settings['pmsendregdays'] * 86400) { return PMSENDREGDAYS; } } $this->load('friend'); if(count($msgto) > 1 && !($is_friend = $_ENV['friend']->is_friend($fromuid, $msgto, 3))) { return PMMSGTONOTFRIEND; } $pmlimit1day = $this->settings['pmlimit1day'] && $_ENV['pm']->count_pm_by_fromuid($this->user['uid'], 86400) > $this->settings['pmlimit1day']; if($pmlimit1day || ($this->settings['pmfloodctrl'] && $_ENV['pm']->count_pm_by_fromuid($this->user['uid'], $this->settings['pmfloodctrl']))) { if(!$_ENV['friend']->is_friend($fromuid, $msgto, 3)) { if(!$_ENV['pm']->is_reply_pm($fromuid, $msgto)) { if($pmlimit1day) { return PMLIMIT1DAY_ERROR; } else { return PMFLOODCTRL_ERROR; } } } } } $lastpmid = 0; foreach($msgto as $uid) { if(!$fromuid || !in_array('{ALL}', $blackls[$uid])) { $blackls[$uid] = $_ENV['user']->name2id($blackls[$uid]); if(!$fromuid || isset($blackls[$uid]) && !in_array($this->user['uid'], $blackls[$uid])) { $lastpmid = $_ENV['pm']->sendpm($subject, $message, $this->user, $uid, $replypmid); } } } return $lastpmid; } function ondelete() { $this->init_input(); $this->user['uid'] = intval($this->input('uid')); $id = $_ENV['pm']->deletepm($this->user['uid'], $this->input('pmids')); return $id; } function ondeleteuser() { $this->init_input(); $this->user['uid'] = intval($this->input('uid')); $id = $_ENV['pm']->deleteuidpm($this->user['uid'], $this->input('touids')); return $id; } function onreadstatus() { $this->init_input(); $this->user['uid'] = intval($this->input('uid')); $_ENV['pm']->set_pm_status($this->user['uid'], $this->input('uids'), $this->input('pmids'), $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'); $folder = $this->input('folder'); $filter = $this->input('filter'); $page = $this->input('page'); $folder = in_array($folder, array('newbox', 'inbox', 'outbox', 'searchbox')) ? $folder : 'inbox'; if($folder != 'searchbox') { $filter = $filter ? (in_array($filter, array('newpm', 'privatepm', 'systempm', 'announcepm')) ? $filter : '') : ''; } $msglen = $this->input('msglen'); $this->user['uid'] = intval($this->input('uid')); if($folder != 'searchbox') { $pmnum = $_ENV['pm']->get_num($this->user['uid'], $folder, $filter); $start = $this->page_get_start($page, $pagesize, $pmnum); } else { $pmnum = $pagesize; $start = ($page - 1) * $pagesize; } if($pagesize > 0) { $pms = $_ENV['pm']->get_pm_list($this->user['uid'], $pmnum, $folder, $filter, $start, $pagesize); if(is_array($pms) && !empty($pms)) { foreach($pms as $key => $pm) { if($msglen) { $pms[$key]['message'] = htmlspecialchars($_ENV['pm']->removecode($pms[$key]['message'], $msglen)); } else { unset($pms[$key]['message']); } unset($pms[$key]['folder']); } } $result['data'] = $pms; } $result['count'] = $pmnum; return $result; } function onviewnode() { $this->init_input(); $this->user['uid'] = intval($this->input('uid')); $pmid = $_ENV['pm']->pmintval($this->input('pmid')); $type = $this->input('type'); $pm = $_ENV['pm']->get_pmnode_by_pmid($this->user['uid'], $pmid, $type); if($pm) { require_once UC_ROOT.'lib/uccode.class.php'; $this->uccode = new uccode(); $pm['message'] = $this->uccode->complie($pm['message']); return $pm; } } function onview() { $this->init_input(); $this->user['uid'] = intval($this->input('uid')); $touid = $this->input('touid'); $pmid = $_ENV['pm']->pmintval($this->input('pmid')); $daterange = $this->input('daterange'); if(empty($pmid)) { $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; $pms = $_ENV['pm']->get_pm_by_touid($this->user['uid'], $touid, $starttime, $endtime); } else { $pms = $_ENV['pm']->get_pm_by_pmid($this->user['uid'], $pmid); } require_once UC_ROOT.'lib/uccode.class.php'; $this->uccode = new uccode(); $status = FALSE; foreach($pms as $key => $pm) { $pms[$key]['message'] = $this->uccode->complie($pms[$key]['message']); !$status && $status = $pm['msgtoid'] && $pm['new']; } $status && $_ENV['pm']->set_pm_status($this->user['uid'], $touid, $pmid); return $pms; } 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); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/pm.php
PHP
asf20
8,108
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: domain.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); class domaincontrol extends base { function __construct() { $this->domaincontrol(); } function domaincontrol() { parent::__construct(); $this->init_input(); $this->load('domain'); } function onls() { return $_ENV['domain']->get_list(1, 9999, 9999); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/domain.php
PHP
asf20
511
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: friend.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); class friendcontrol extends base { function __construct() { $this->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; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/friend.php
PHP
asf20
1,532
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: app.php 884 2008-12-16 01:13:31Z monkey $ */ !defined('IN_UC') && exit('Access Denied'); class appcontrol extends base { function __construct() { $this->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 _random($length, $numeric = 0) { } function _generate_key() { } function _format_notedata($notedata) { } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/app.php
PHP
asf20
925
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: feed.php 883 2008-12-16 00:51:21Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); class feedcontrol extends base { function __construct() { $this->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('<br>', '<br />', '<BR>', '<BR />'), "\n", $template); $template = str_replace(array('<b>', '<B>'), '[B]', $template); $template = str_replace(array('<i>', '<I>'), '[I]', $template); $template = str_replace(array('<u>', '<U>'), '[U]', $template); $template = str_replace(array('</b>', '</B>'), '[/B]', $template); $template = str_replace(array('</i>', '</I>'), '[/I]', $template); $template = str_replace(array('</u>', '</U>'), '[/U]', $template); $template = htmlspecialchars($template); $template = nl2br($template); $template = str_replace(array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]'), array('<b>', '<i>', '<u>', '</b>', '</i>', '</u>'), $template); return $template; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/feed.php
PHP
asf20
4,028
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: tag.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); class tagcontrol extends base { function __construct() { $this->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; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/tag.php
PHP
asf20
2,012
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: cache.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); class cachecontrol extends base { function __construct() { $this->cachecontrol(); } function cachecontrol() { parent::__construct(); } function onupdate($arr) { $this->load("cache"); $_ENV['cache']->updatedata(); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/control/cache.php
PHP
asf20
473
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: client.php 919 2009-01-21 01:25:32Z zhaoxiongfei $ */ if(!defined('UC_API')) { exit('Access denied'); } error_reporting(0); define('IN_UC', TRUE); define('UC_CLIENT_VERSION', '1.5.0'); define('UC_CLIENT_RELEASE', '20090121'); define('UC_ROOT', substr(__FILE__, 0, -10)); define('UC_DATADIR', UC_ROOT.'./data/'); define('UC_DATAURL', UC_API.'/data'); define('UC_API_FUNC', UC_CONNECT == 'mysql' ? 'uc_api_mysql' : 'uc_api_post'); $GLOBALS['uc_controls'] = array(); function uc_addslashes($string, $force = 0, $strip = FALSE) { !defined('MAGIC_QUOTES_GPC') && define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc()); if(!MAGIC_QUOTES_GPC || $force) { if(is_array($string)) { foreach($string as $key => $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); } } function uc_stripslashes($string) { !defined('MAGIC_QUOTES_GPC') && define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc()); if(MAGIC_QUOTES_GPC) { return stripslashes($string); } else { return $string; } } 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(uc_stripslashes($v2)); $sep2 = '&'; } $s .= $sep.$s2; } else { $s .= "$sep$k=".urlencode(uc_stripslashes($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); $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) { $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/db.class.php'; include_once UC_ROOT.'./model/base.php'; include_once UC_ROOT."./control/$model.php"; eval("\$uc_controls['$model'] = new {$model}control();"); } 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((substr($result, 0, 10) == 0 || 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) { $__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); } function uc_fopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE) { $return = ''; $matches = parse_url($url); !isset($matches['host']) && $matches['host'] = ''; !isset($matches['path']) && $matches['path'] = ''; !isset($matches['query']) && $matches['query'] = ''; !isset($matches['port']) && $matches['port'] = ''; $host = $matches['host']; $path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/'; $port = !empty($matches['port']) ? $matches['port'] : 80; if($post) { $out = "POST $path HTTP/1.0\r\n"; $out .= "Accept: */*\r\n"; //$out .= "Referer: $boardurl\r\n"; $out .= "Accept-Language: zh-cn\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded\r\n"; $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n"; $out .= "Host: $host\r\n"; $out .= 'Content-Length: '.strlen($post)."\r\n"; $out .= "Connection: Close\r\n"; $out .= "Cache-Control: no-cache\r\n"; $out .= "Cookie: $cookie\r\n\r\n"; $out .= $post; } else { $out = "GET $path HTTP/1.0\r\n"; $out .= "Accept: */*\r\n"; //$out .= "Referer: $boardurl\r\n"; $out .= "Accept-Language: zh-cn\r\n"; $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n"; $out .= "Host: $host\r\n"; $out .= "Connection: Close\r\n"; $out .= "Cookie: $cookie\r\n\r\n"; } $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout); if(!$fp) { return ''; } else { stream_set_blocking($fp, $block); stream_set_timeout($fp, $timeout); @fwrite($fp, $out); $status = stream_get_meta_data($fp); if(!$status['timed_out']) { while (!feof($fp)) { 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 = '') { return call_user_func(UC_API_FUNC, 'user', 'register', array('username'=>$username, 'password'=>$password, 'email'=>$email, 'questionid'=>$questionid, 'answer'=>$answer)); } function uc_user_login($username, $password, $isuid = 0, $checkques = 0, $questionid = '', $answer = '') { $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)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); } function uc_user_synlogin($uid) { $uid = intval($uid); $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); return $return; } function uc_user_synlogout() { $return = uc_api_post('user', 'synlogout', array()); return $return; } function uc_user_edit($username, $oldpw, $newpw, $email, $ignoreoldpw = 0, $questionid = '', $answer = '') { return call_user_func(UC_API_FUNC, 'user', 'edit', array('username'=>$username, 'oldpw'=>$oldpw, 'newpw'=>$newpw, 'email'=>$email, 'ignoreoldpw'=>$ignoreoldpw, 'questionid'=>$questionid, 'answer'=>$answer)); } function uc_user_delete($uid) { return call_user_func(UC_API_FUNC, 'user', 'delete', array('uid'=>$uid)); } function uc_user_deleteavatar($uid) { 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_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_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_pm_location($uid, $newpm = 0) { $apiurl = uc_api_url('pm_client', 'ls', "uid=$uid", ($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) { 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)); } else { $fromuid = intval($fromuid); $subject = urlencode($subject); $msgto = urlencode($msgto); $message = urlencode($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, 'folder'=>$folder, '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_readstatus($uid, $uids, $pmids = array(), $status = 0) { return call_user_func(UC_API_FUNC, 'pm', 'readstatus', array('uid'=>$uid, 'uids'=>$uids, 'pmids'=>$pmids, '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, 'folder'=>$folder, '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, $touid = 0, $daterange = 1) { $uid = intval($uid); $touid = intval($touid); $pmid = @is_numeric($pmid) ? $pmid : 0; $return = call_user_func(UC_API_FUNC, 'pm', 'view', array('uid'=>$uid, 'pmid'=>$pmid, 'touid'=>$touid, 'daterange'=>$daterange)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); } function uc_pm_viewnode($uid, $type = 0, $pmid = 0) { $uid = intval($uid); $pmid = @is_numeric($pmid) ? $pmid : 0; $return = call_user_func(UC_API_FUNC, 'pm', 'viewnode', array('uid'=>$uid, 'pmid'=>$pmid, 'type'=>$type)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); } 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"); $uc_avatarflash = UC_API.'/images/camera.swf?inajax=1&appid='.UC_APPID.'&input='.$uc_input.'&agent='.md5($_SERVER['HTTP_USER_AGENT']).'&ucapi='.urlencode(str_replace('http://', '', UC_API)).'&avatartype='.$type; if($returnhtml) { return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="447" height="477" id="mycamera" align="middle"> <param name="allowScriptAccess" value="always" /> <param name="scale" value="exactfit" /> <param name="wmode" value="transparent" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="movie" value="'.$uc_avatarflash.'" /> <param name="menu" value="false" /> <embed src="'.$uc_avatarflash.'" quality="high" bgcolor="#ffffff" width="447" height="477" name="mycamera" align="middle" allowScriptAccess="always" allowFullScreen="false" scale="exactfit" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>'; } else { return array( 'width', '447', 'height', '477', 'scale', 'exactfit', 'src', $uc_avatarflash, 'id', 'mycamera', 'name', 'mycamera', 'quality','high', 'bgcolor','#ffffff', 'wmode','transparent', 'menu', 'false', 'swLiveConnect', 'true', 'allowScriptAccess', 'always' ); } } 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') { $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; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/client.php
PHP
asf20
19,435
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: uccode.class.php 753 2008-11-14 06:48:25Z cnteacher $ */ class uccode { var $uccodes; function uccode() { $this->uccode = array( 'pcodecount' => -1, 'codecount' => 0, 'codehtml' => '' ); } 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 = htmlspecialchars($message); if(strpos($message, '[/code]') !== FALSE) { $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "\$this->codedisp('\\1')", $message); } if(strpos($message, '[/url]') !== FALSE) { $message = preg_replace("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)([^\[\"']+?))?\](.+?)\[\/url\]/ies", "\$this->parseurl('\\1', '\\5')", $message); } if(strpos($message, '[/email]') !== FALSE) { $message = preg_replace("/\[email(=([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+))?\](.+?)\[\/email\]/ies", "\$this->parseemail('\\1', '\\4')", $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( '</font>', '</font>', '</font>', '</p>', '<strong>', '</strong>', '<i>', '</i>', '<u>', '</u>', '<ul>', '<ul type="1">', '<ul type="a">', '<ul type="A">', '<li>', '</ul>', '<blockquote>', '</blockquote>', '</span>' ), 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( "<font color=\"\\1\">", "<font size=\"\\1\">", "<font style=\"font-size: \\1\">", "<font face=\"\\1 \">", "<p align=\"\\1\">", "<span style=\"float: \\1;\">" ), $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(array( "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies", "/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies" ), array( "\$this->bbcodeurl('\\1', '<img src=\"%s\" border=\"0\" alt=\"\" />')", "\$this->bbcodeurl('\\3', '<img width=\"\\1\" height=\"\\2\" src=\"%s\" border=\"0\" alt=\"\" />')" ), $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('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;'), $message)); } 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 '<a href="'.(substr(strtolower($url), 0, 4) == 'www.' ? 'http://'.$url : $url).'" target="_blank">'.$text.'</a>'; } else { $url = substr($url, 1); if(substr(strtolower($url), 0, 4) == 'www.') { $url = 'http://'.$url; } return '<a href="'.$url.'" target="_blank">'.$text.'</a>'; } } function parseemail($email, $text) { if(!$email && preg_match("/\s*([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+)\s*/i", $text, $matches)) { $email = trim($matches[0]); return '<a href="mailto:'.$email.'">'.$email.'</a>'; } else { return '<a href="mailto:'.substr($email, 1).'">'.$text.'</a>'; } } 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 '&nbsp;'.$url; } } function tpl_codedisp($code) { return '<div class="blockcode"><code id="code'.$this->uccodes['codecount'].'">'.$code.'</code></div>'; } function tpl_quote() { return '<div class="quote"><blockquote>\\1</blockquote></div>'; } } /* Usage: $str = <<<EOF 1 2 3 EOF; require_once 'lib/uccode.class.php'; $this->uccode = new uccode(); echo $this->uccode->complie($str); */ ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/lib/uccode.class.php
PHP
asf20
5,020
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: db.class.php 753 2008-11-14 06:48:25Z cnteacher $ */ class db { var $querynum = 0; var $link; var $histories; var $dbhost; var $dbuser; var $dbpw; var $dbcharset; var $pconnect; var $tablepre; var $time; var $goneaway = 5; function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset = '', $pconnect = 0, $tablepre='', $time = 0) { $this->dbhost = $dbhost; $this->dbuser = $dbuser; $this->dbpw = $dbpw; $this->dbname = $dbname; $this->dbcharset = $dbcharset; $this->pconnect = $pconnect; $this->tablepre = $tablepre; $this->time = $time; if($pconnect) { if(!$this->link = mysql_pconnect($dbhost, $dbuser, $dbpw)) { $this->halt('Can not connect to MySQL server'); } } else { if(!$this->link = mysql_connect($dbhost, $dbuser, $dbpw)) { $this->halt('Can not connect to MySQL server'); } } if($this->version() > '4.1') { if($dbcharset) { mysql_query("SET character_set_connection=".$dbcharset.", character_set_results=".$dbcharset.", character_set_client=binary", $this->link); } if($this->version() > '5.0.1') { mysql_query("SET sql_mode=''", $this->link); } } if($dbname) { mysql_select_db($dbname, $this->link); } } function fetch_array($query, $result_type = MYSQL_ASSOC) { return mysql_fetch_array($query, $result_type); } 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 cache_gc() { $this->query("DELETE FROM {$this->tablepre}sqlcaches WHERE expiry<$this->time"); } function query($sql, $type = '', $cachetime = FALSE) { $func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ? 'mysql_unbuffered_query' : 'mysql_query'; if(!($query = $func($sql, $this->link)) && $type != 'SILENT') { $this->halt('MySQL Query Error', $sql); } $this->querynum++; $this->histories[] = $sql; return $query; } function affected_rows() { return mysql_affected_rows($this->link); } function error() { return (($this->link) ? mysql_error($this->link) : mysql_error()); } function errno() { return intval(($this->link) ? mysql_errno($this->link) : mysql_errno()); } function result($query, $row) { $query = @mysql_result($query, $row); return $query; } function num_rows($query) { $query = mysql_num_rows($query); return $query; } function num_fields($query) { return mysql_num_fields($query); } function free_result($query) { return mysql_free_result($query); } function insert_id() { return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); } function fetch_row($query) { $query = mysql_fetch_row($query); return $query; } function fetch_fields($query) { return mysql_fetch_field($query); } function version() { return mysql_get_server_info($this->link); } function close() { return mysql_close($this->link); } function halt($message = '', $sql = '') { $error = mysql_error(); $errorno = mysql_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 = '<b>Error:</b>'.$error.'<br />'; $s .= '<b>Errno:</b>'.$errorno.'<br />'; $s .= '<b>SQL:</b>:'.$sql; exit($s); } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/lib/db.class.php
PHP
asf20
3,977
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: sendmail.inc.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); if($mail_setting['mailsilent']) { error_reporting(0); } $maildelimiter = $mail_setting['maildelimiter'] == 1 ? "\r\n" : ($mail_setting['maildelimiter'] == 2 ? "\r" : "\n"); $mailusername = isset($mail_setting['mailusername']) ? $mail_setting['mailusername'] : 1; $appname = $this->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; } $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; 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 = fsockopen($mail_setting['mailserver'], $mail_setting['mailport'], $errno, $errstr, 30)) { return false; } stream_set_blocking($fp, true); $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); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/lib/sendmail.inc.php
PHP
asf20
5,010
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: xml.class.php 846 2008-12-08 05:37:05Z zhaoxiongfei $ */ function xml_unserialize(&$xml, $isnormal = FALSE) { $xml_parser = new XML($isnormal); $data = $xml_parser->parse($xml); $xml_parser->destruct(); return $data; } function xml_serialize($arr, $htmlon = FALSE, $isnormal = FALSE, $level = 1) { $s = $level == 1 ? "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<root>\r\n" : ''; $space = str_repeat("\t", $level); foreach($arr as $k => $v) { if(!is_array($v)) { $s .= $space."<item id=\"$k\">".($htmlon ? '<![CDATA[' : '').$v.($htmlon ? ']]>' : '')."</item>\r\n"; } else { $s .= $space."<item id=\"$k\">\r\n".xml_serialize($v, $htmlon, $isnormal, $level + 1).$space."</item>\r\n"; } } $s = preg_replace("/([\x01-\x09\x0b-\x0c\x0e-\x1f])+/", ' ', $s); return $level == 1 ? $s."</root>" : $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->failed = FALSE; if(!$this->isnormal) { if(isset($attributes['id']) && !is_string($this->document[$attributes['id']])) { $this->document = &$this->document[$attributes['id']]; } else { $this->failed = TRUE; } } else { if(!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; } else { $this->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]; } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/lib/xml.class.php
PHP
asf20
2,771
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: mail.php 848 2008-12-08 05:43:39Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); define('UC_MAIL_REPEAT', 5); class mailmodel { var $db; var $base; var $apps; function __construct(&$base) { $this->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'] = htmlspecialchars($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; $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 .= ','.$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'"); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/mail.php
PHP
asf20
5,074
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: base.php 837 2008-12-05 03:14:47Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); if(!function_exists('getgpc')) { function getgpc($k, $var='G') { 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; } } class base { var $time; var $onlineip; var $db; var $key; var $settings = array(); var $cache = array(); var $app = array(); var $user = array(); var $input = array(); function __construct() { $this->base(); } function base() { $this->init_var(); $this->init_db(); $this->init_cache(); $this->init_note(); $this->init_mail(); } function init_var() { $this->time = time(); $cip = getenv('HTTP_CLIENT_IP'); $xip = getenv('HTTP_X_FORWARDED_FOR'); $rip = getenv('REMOTE_ADDR'); $srip = $_SERVER['REMOTE_ADDR']; if($cip && strcasecmp($cip, 'unknown')) { $this->onlineip = $cip; } elseif($xip && strcasecmp($xip, 'unknown')) { $this->onlineip = $xip; } elseif($rip && strcasecmp($rip, 'unknown')) { $this->onlineip = $rip; } elseif($srip && strcasecmp($srip, 'unknown')) { $this->onlineip = $srip; } preg_match("/[\d\.]{7,15}/", $this->onlineip, $match); $this->onlineip = $match[0] ? $match[0] : 'unknown'; $this->app['appid'] = UC_APPID; } function init_input() { } function init_db() { require_once UC_ROOT.'lib/db.class.php'; $this->db = new db(); $this->db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, '', UC_DBCHARSET, UC_DBCONNECT, UC_DBTABLEPRE); } function load($model, $base = NULL) { $base = $base ? $base : $this; if(empty($_ENV[$model])) { require_once UC_ROOT."./model/$model.php"; eval('$_ENV[$model] = new '.$model.'model($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 &cache($cachefile) { static $_CACHE = array(); if(!isset($_CACHE[$cachefile])) { $cachepath = UC_DATADIR.'./cache/'.$cachefile.'.php'; if(!file_exists($cachepath)) { $this->load('cache'); $_ENV['cache']->updatedata($cachefile); } else { include_once $cachepath; } } return $_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('&amp;', '&quot;', '&lt;', '&gt;'), 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('&amp;', '&quot;', '&lt;', '&gt;'), $strcut); return $strcut.$dot; } function init_note() { if($this->note_exists()) { $this->load('note'); $_ENV['note']->send(); } } function note_exists() { $noteexists = $this->db->fetch_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 serialize() { } */ 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->fetch_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; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/base.php
PHP
asf20
6,440
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: pm.php 908 2008-12-26 07:27:51Z monkey $ */ !defined('IN_UC') && exit('Access Denied'); class pmmodel { var $db; var $base; function __construct(&$base) { $this->pmmodel($base); } function pmmodel(&$base) { $this->base = $base; $this->db = $base->db; } function pmintval($pmid) { return @is_numeric($pmid) ? $pmid : 0; } function get_pm_by_pmid($uid, $pmid) { $arr = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE pmid='$pmid' AND (msgtoid IN ('$uid','0') OR msgfromid='$uid')"); return $arr; } function get_pm_by_touid($uid, $touid, $starttime, $endtime) { $arr1 = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$uid' AND msgtoid='$touid' AND dateline>='$starttime' AND dateline<'$endtime' AND related>'0' AND delstatus IN (0,2) ORDER BY dateline"); $arr2 = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$touid' AND msgtoid='$uid' AND dateline>='$starttime' AND dateline<'$endtime' AND related>'0' AND delstatus IN (0,1) ORDER BY dateline"); $arr = array_merge($arr1, $arr2); uasort($arr, 'pm_datelinesort'); return $arr; } function get_pmnode_by_pmid($uid, $pmid, $type = 0) { $arr = array(); if($type == 1) { $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$uid' and folder='inbox' ORDER BY dateline DESC LIMIT 1"); } elseif($type == 2) { $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE msgtoid='$uid' and folder='inbox' ORDER BY dateline DESC LIMIT 1"); } else { $arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE pmid='$pmid'"); } return $arr; } function set_pm_status($uid, $touid, $pmid = 0, $status = 0) { if(!$status) { $oldstatus = 1; $newstatus = 0; } else { $oldstatus = 0; $newstatus = 1; } if($touid) { $ids = is_array($touid) ? $this->base->implode($touid) : $touid; $this->db->query("UPDATE ".UC_DBTABLEPRE."pms SET new='$newstatus' WHERE msgfromid IN ($ids) AND msgtoid='$uid' AND new='$oldstatus'", 'UNBUFFERED'); } if($pmid) { $ids = is_array($pmid) ? $this->base->implode($pmid) : $pmid; $this->db->query("UPDATE ".UC_DBTABLEPRE."pms SET new='$newstatus' WHERE pmid IN ($ids) AND msgtoid='$uid' AND new='$oldstatus'", 'UNBUFFERED'); } } function get_pm_num() { } function get_num($uid, $folder, $filter = '') { switch($folder) { case 'newbox': $sql = "SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE msgtoid='$uid' AND (related='0' AND msgfromid>'0' OR msgfromid='0') AND folder='inbox' AND new='1'"; $num = $this->db->result_first($sql); return $num; case 'outbox': case 'inbox': if($filter == 'newpm') { $filteradd = "msgtoid='$uid' AND (related='0' AND msgfromid>'0' OR msgfromid='0') AND folder='inbox' AND new='1'"; } elseif($filter == 'systempm') { $filteradd = "msgtoid='$uid' AND msgfromid='0' AND folder='inbox'"; } elseif($filter == 'privatepm') { $filteradd = "msgtoid='$uid' AND related='0' AND msgfromid>'0' AND folder='inbox'"; } elseif($filter == 'announcepm') { $filteradd = "msgtoid='0' AND folder='inbox'"; } else { $filteradd = "msgtoid='$uid' AND related='0' AND folder='inbox'"; } $sql = "SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE $filteradd"; break; case 'savebox': break; } $num = $this->db->result_first($sql); return $num; } function get_pm_list($uid, $pmnum, $folder, $filter, $start, $ppp = 10) { $ppp = $ppp ? $ppp : 10; switch($folder) { case 'newbox': $folder = 'inbox'; $filter = 'newpm'; case 'outbox': case 'inbox': if($filter == 'newpm') { $filteradd = "pm.msgtoid='$uid' AND (pm.related='0' AND pm.msgfromid>'0' OR pm.msgfromid='0') AND pm.folder='inbox' AND pm.new='1'"; } elseif($filter == 'systempm') { $filteradd = "pm.msgtoid='$uid' AND pm.msgfromid='0' AND pm.folder='inbox'"; } elseif($filter == 'privatepm') { $filteradd = "pm.msgtoid='$uid' AND pm.related='0' AND pm.msgfromid>'0' AND pm.folder='inbox'"; } elseif($filter == 'announcepm') { $filteradd = "pm.msgtoid='0' AND pm.folder='inbox'"; } else { $filteradd = "pm.msgtoid='$uid' AND pm.related='0' AND pm.folder='inbox'"; } $sql = "SELECT pm.*,m.username as msgfrom FROM ".UC_DBTABLEPRE."pms pm LEFT JOIN ".UC_DBTABLEPRE."members m ON pm.msgfromid = m.uid WHERE $filteradd ORDER BY pm.dateline DESC LIMIT $start, $ppp"; break; case 'searchbox': $filteradd = "msgtoid='$uid' AND folder='inbox' AND message LIKE '%".(str_replace('_', '\_', addcslashes($filter, '%_')))."%'"; $sql = "SELECT * FROM ".UC_DBTABLEPRE."pms WHERE $filteradd ORDER BY dateline DESC LIMIT $start, $ppp"; break; case 'savebox': break; } $query = $this->db->query($sql); $array = array(); $today = $this->base->time - $this->base->time % 86400; while($data = $this->db->fetch_array($query)) { $daterange = 5; if($data['dateline'] >= $today) { $daterange = 1; } elseif($data['dateline'] >= $today - 86400) { $daterange = 2; } elseif($data['dateline'] >= $today - 172800) { $daterange = 3; } elseif($data['dateline'] >= $today - 604800) { $daterange = 4; } $data['daterange'] = $daterange; $data['subject'] = htmlspecialchars($data['subject']); if($filter == 'announcepm') { unset($data['msgfromid'], $data['msgfrom']); } $data['touid'] = $uid == $data['msgfromid'] ? $data['msgtoid'] : $data['msgfromid']; $array[] = $data; } if($folder == 'inbox') { $this->db->query("DELETE FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'", 'UNBUFFERED'); } return $array; } function sendpm($subject, $message, $msgfrom, $msgto, $related = 0) { if($msgfrom['uid'] && $msgfrom['uid'] == $msgto) { return 0; } $_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); } $box = 'inbox'; $subject = trim($subject); if($subject == '' && !$related) { $subject = $this->removecode(trim($message), 75); } else { $subject = $this->base->cutstr(trim($subject), 75, ' '); } if($msgfrom['uid']) { $sessionexist = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$msgfrom[uid]' AND msgtoid='$msgto' AND folder='inbox' AND related='0'"); if(!$sessionexist || $sessionexist > 1) { if($sessionexist > 1) { $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$msgfrom[uid]' AND msgtoid='$msgto' AND folder='inbox' AND related='0'"); } $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pms (msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,related,message,fromappid) VALUES ('".$msgfrom['username']."','".$msgfrom['uid']."','$msgto','$box','1','$subject','".$this->base->time."','0','$message','".$this->base->app['appid']."')"); $lastpmid = $this->db->insert_id(); } else { $this->db->query("UPDATE ".UC_DBTABLEPRE."pms SET subject='$subject', message='$message', dateline='".$this->base->time."', new='1', fromappid='".$this->base->app['appid']."' WHERE msgfromid='$msgfrom[uid]' AND msgtoid='$msgto' AND folder='inbox' AND related='0'"); } if(!$savebox) { $sessionexist = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$msgto' AND msgtoid='$msgfrom[uid]' AND folder='inbox' AND related='0'"); if($msgfrom['uid'] && !$sessionexist) { $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pms (msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,related,message,fromappid) VALUES ('".$msgfrom['username']."','$msgto','".$msgfrom['uid']."','$box','0','$subject','".$this->base->time."','0','$message','0')"); } $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pms (msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,related,message,fromappid) VALUES ('".$msgfrom['username']."','".$msgfrom['uid']."','$msgto','$box','1','$subject','".$this->base->time."','1','$message','".$this->base->app['appid']."')"); $lastpmid = $this->db->insert_id(); } } else { $this->db->query("INSERT INTO ".UC_DBTABLEPRE."pms (msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,related,message,fromappid) VALUES ('".$msgfrom['username']."','".$msgfrom['uid']."','$msgto','$box','1','$subject','".$this->base->time."','0','$message','".$this->base->app['appid']."')"); $lastpmid = $this->db->insert_id(); } $this->db->query("REPLACE INTO ".UC_DBTABLEPRE."newpm (uid) VALUES ('$msgto')"); return $lastpmid; } function set_ignore($uid) { $this->db->query("DELETE FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); } function check_newpm($uid, $more) { if($more < 2) { $newpm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."newpm WHERE uid='$uid'"); if($newpm) { $newpm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE (related='0' AND msgfromid>'0' OR msgfromid='0') AND msgtoid='$uid' AND folder='inbox' AND new='1'"); if($more) { $newprvpm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE related='0' AND msgfromid>'0' AND msgtoid='$uid' AND folder='inbox' AND new='1'"); return array('newpm' => $newpm, 'newprivatepm' => $newprvpm); } else { return $newpm; } } } else { $newpm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE (related='0' AND msgfromid>'0' OR msgfromid='0') AND msgtoid='$uid' AND folder='inbox' AND new='1'"); $newprvpm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE related='0' AND msgfromid>'0' AND msgtoid='$uid' AND folder='inbox' AND new='1'"); if($more == 2 || $more == 3) { $annpm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE related='0' AND msgtoid='0' AND folder='inbox'"); $syspm = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."pms WHERE related='0' AND msgtoid='$uid' AND folder='inbox' AND msgfromid='0'"); } if($more == 2) { return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'announcepm' => $annpm, 'systempm' => $syspm); } if($more == 4) { return array('newpm' => $newpm, 'newprivatepm' => $newprvpm); } else { $pm = $this->db->fetch_first("SELECT pm.dateline,pm.msgfromid,m.username as msgfrom,pm.message FROM ".UC_DBTABLEPRE."pms pm LEFT JOIN ".UC_DBTABLEPRE."members m ON pm.msgfromid = m.uid WHERE (pm.related='0' OR pm.msgfromid='0') AND pm.msgtoid='$uid' AND pm.folder='inbox' ORDER BY pm.dateline DESC LIMIT 1"); return array('newpm' => $newpm, 'newprivatepm' => $newprvpm, 'announcepm' => $annpm, 'systempm' => $syspm, 'lastdate' => $pm['dateline'], 'lastmsgfromid' => $pm['msgfromid'], 'lastmsgfrom' => $pm['msgfrom'], 'lastmsg' => $pm['message']); } } } function deletepm($uid, $pmids) { $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pms WHERE msgtoid='$uid' AND pmid IN (".$this->base->implode($pmids).")"); $delnum = $this->db->affected_rows(); return $delnum; } function deleteuidpm($uid, $ids) { $delnum = 0; if($ids) { $delnum = 1; $deluids = $this->base->implode($ids); $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pms WHERE msgfromid IN ($deluids) AND msgtoid='$uid' AND folder='inbox' AND related='0'", 'UNBUFFERED'); $this->db->query("UPDATE ".UC_DBTABLEPRE."pms SET delstatus=2 WHERE msgfromid IN ($deluids) AND msgtoid='$uid' AND folder='inbox' AND delstatus=0", 'UNBUFFERED'); $this->db->query("UPDATE ".UC_DBTABLEPRE."pms SET delstatus=1 WHERE msgtoid IN ($deluids) AND msgfromid='$uid' AND folder='inbox' AND delstatus=0", 'UNBUFFERED'); $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pms WHERE msgfromid IN ($deluids) AND msgtoid='$uid' AND delstatus=1 AND folder='inbox'", 'UNBUFFERED'); $this->db->query("DELETE FROM ".UC_DBTABLEPRE."pms WHERE msgtoid IN ($deluids) AND msgfromid='$uid' AND delstatus=2 AND folder='inbox'", 'UNBUFFERED'); } return $delnum; } function get_blackls($uid, $uids = array()) { if(!$uids) { $blackls = $this->db->result_first("SELECT blacklist FROM ".UC_DBTABLEPRE."memberfields WHERE uid='$uid'"); } else { $uids = $this->base->implode($uids); $blackls = array(); $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) { return trim($this->base->cutstr(preg_replace(array( "/\[(email|code|quote|img)=?.*\].*?\[\/(email|code|quote|img)\]/siU", "/\[\/?(b|i|url|u|color|size|font|align|list|indent|float)=?.*\]/siU", "/\r\n/", ), '', $str), $length)); } function count_pm_by_fromuid($uid, $timeoffset = 86400) { $dateline = $this->base->time - intval($timeoffset); return $this->db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pms WHERE msgfromid='$uid' AND dateline>'$dateline'"); } function is_reply_pm($uid, $touids) { $touid_str = implode("', '", $touids); $pm_reply = $this->db->fetch_all("SELECT msgfromid, msgtoid FROM ".UC_DBTABLEPRE."pms WHERE msgfromid IN ('$touid_str') AND msgtoid='$uid' AND related=1", 'msgfromid'); foreach($touids as $val) { if(!isset($pm_reply[$val])) { return false; } } return true; } } function pm_datelinesort($a, $b) { if ($a['dateline'] == $b['dateline']) { return 0; } return ($a['dateline'] < $b['dateline']) ? -1 : 1; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/pm.php
PHP
asf20
16,049
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: domain.php 848 2008-12-08 05:43:39Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); class domainmodel { var $db; var $base; function __construct(&$base) { $this->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(); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/domain.php
PHP
asf20
1,391
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: note.php 916 2009-01-19 05:56:07Z monkey $ */ !defined('IN_UC') && exit('Access Denied'); define('UC_NOTE_REPEAT', 5); define('UC_NOTE_TIMEOUT', 15); define('UC_NOTE_GC', 10000); define('API_RETURN_FAILED', '-1'); class notemodel { var $db; var $base; var $apps; var $operations = array(); var $notetype = 'HTTP'; function __construct(&$base) { $this->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() { $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($app['extra']['apppath'] && @include $app['extra']['apppath'].'./api/'.$apifilename) { $uc_note = new uc_note(); $method = $note['operation']; if(is_string($method) && !empty($method)) { parse_str($note['getdata'], $note['getdata']); if(get_magic_quotes_gpc()) { $note['getdata'] = $this->base->dstripslashes($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() { $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; //$closedsqladd = ",closed='1'"; } } 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"; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/note.php
PHP
asf20
6,591
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: user.php 878 2008-12-15 03:27:41Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); class usermodel { var $db; var $base; function __construct(&$base) { $this->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'"); file_put_contents("t.txt",$arr['uid'].'/'.$arr['username'].'/'.$arr['password']); return $arr; } function check_username($username) { $guestexp = '\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8'; $len = strlen($username); if($len > 15 || $len < 3 || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&]|$guestexp/is", $username)) { return FALSE; } else { return TRUE; } } 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 && preg_match("/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $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_login($username, $password, &$user) { $user = $this->get_user_by_username($username); if(empty($user['username'])) { return -1; } elseif($user['password'] != md5($password)) { return -2; } return $user['uid']; } function add_user($username, $password, $email, $uid = 0, $questionid = '', $answer = '') { $salt = substr(uniqid(rand()), -6); $password = md5($password); $sqladd = $uid ? "uid='".intval($uid)."'," : ''; $sqladd .= $questionid > 0 ? " secques='".$this->quescrypt($questionid, $answer)."'," : " secques='',"; $this->db->query("INSERT INTO ".UC_DBTABLEPRE."members SET $sqladd username='$username', password='$password', email='$email', regip='".$this->base->onlineip."', 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 = '') { $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 && $data['password'] != md5(md5($oldpw).$data['salt'])) { return -1; } $sqladd = $newpw ? "password='".md5(md5($newpw).$data['salt'])."'" : ''; $sqladd .= $email ? ($sqladd ? ',' : '')." email='$email'" : ''; 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; $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 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 quescrypt($questionid, $answer) { return $questionid > 0 && $answer != '' ? substr(md5($answer.md5($questionid)), 16, 8) : ''; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/user.php
PHP
asf20
7,058
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: friend.php 773 2008-11-26 08:45:08Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); class friendmodel { var $db; var $base; function __construct(&$base) { $this->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; } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/friend.php
PHP
asf20
3,574
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: app.php 846 2008-12-08 05:37:05Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); class appmodel { var $db; var $base; function __construct(&$base) { $this->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; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/app.php
PHP
asf20
783
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: misc.php 846 2008-12-08 05:37:05Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); define('UC_ARRAY_SEP_1', 'UC_ARRAY_SEP_1'); define('UC_ARRAY_SEP_2', 'UC_ARRAY_SEP_2'); class miscmodel { var $db; var $base; function __construct(&$base) { $this->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) { } //private function alter_app_table($appid, $operation = 'ADD') { } function get_host_by_url($url) { } function check_url($url) { } function check_ip($url) { } function test_api($url, $ip = '') { } function dfopen2($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE') { $__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); } function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE , $ip = '', $timeout = 15, $block = TRUE, $encodetype = 'URLENCODE') { //error_log("[uc_client]\r\nurl: $url\r\npost: $post\r\n\r\n", 3, 'c:/log/php_fopen.txt'); $return = ''; $matches = parse_url($url); $host = $matches['host']; $path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/'; $port = !empty($matches['port']) ? $matches['port'] : 80; if($post) { $out = "POST $path HTTP/1.0\r\n"; $out .= "Accept: */*\r\n"; //$out .= "Referer: $boardurl\r\n"; $out .= "Accept-Language: zh-cn\r\n"; $boundary = $encodetype == 'URLENCODE' ? '' : ';'.substr($post, 0, trim(strpos($post, "\n"))); $out .= $encodetype == 'URLENCODE' ? "Content-Type: application/x-www-form-urlencoded\r\n" : "Content-Type: multipart/form-data$boundary\r\n"; $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n"; $out .= "Host: $host\r\n"; $out .= 'Content-Length: '.strlen($post)."\r\n"; $out .= "Connection: Close\r\n"; $out .= "Cache-Control: no-cache\r\n"; $out .= "Cookie: $cookie\r\n\r\n"; $out .= $post; } else { $out = "GET $path HTTP/1.0\r\n"; $out .= "Accept: */*\r\n"; //$out .= "Referer: $boardurl\r\n"; $out .= "Accept-Language: zh-cn\r\n"; $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n"; $out .= "Host: $host\r\n"; $out .= "Connection: Close\r\n"; $out .= "Cookie: $cookie\r\n\r\n"; } $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout); if(!$fp) { return ''; } else { stream_set_blocking($fp, $block); stream_set_timeout($fp, $timeout); @fwrite($fp, $out); $status = stream_get_meta_data($fp); if(!$status['timed_out']) { while (!feof($fp)) { 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.$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; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/misc.php
PHP
asf20
4,191
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: tag.php 753 2008-11-14 06:48:25Z cnteacher $ */ !defined('IN_UC') && exit('Access Denied'); class tagmodel { var $db; var $base; function __construct(&$base) { $this->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')"); } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/tag.php
PHP
asf20
2,212
<?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: cache.php 846 2008-12-08 05:37:05Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); if(!function_exists('file_put_contents')) { function file_put_contents($filename, $s) { $fp = @fopen($filename, 'w'); @fwrite($fp, $s); @fclose($fp); } } class cachemodel { var $db; var $base; var $map; function __construct(&$base) { $this->cachemodel($base); } function cachemodel(&$base) { $this->base = $base; $this->db = $base->db; $this->map = array( 'settings' => array('settings'), 'badwords' => array('badwords'), 'apps' => array('apps') ); } //public function updatedata($cachefile = '') { if($cachefile) { foreach((array)$this->map[$cachefile] as $modules) { $s = "<?php\r\n"; foreach((array)$modules as $m) { $method = "_get_$m"; $s .= '$_CACHE[\''.$m.'\'] = '.var_export($this->$method(), TRUE).";\r\n"; } $s .= "\r\n?>"; @file_put_contents(UC_DATADIR."./cache/$cachefile.php", $s); } } else { foreach((array)$this->map as $file => $modules) { $s = "<?php\r\n"; foreach($modules as $m) { $method = "_get_$m"; $s .= '$_CACHE[\''.$m.'\'] = '.var_export($this->$method(), TRUE).";\r\n"; } $s .= "\r\n?>"; @file_put_contents(UC_DATADIR."./cache/$file.php", $s); } } } function updatetpl() { } //private 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; } //private function _get_apps() { $this->base->load('app'); $apps = $_ENV['app']->get_apps(); $apps2 = array(); if(is_array($apps)) { foreach($apps as $v) { $v['extra'] = unserialize($v['extra']); $apps2[$v['appid']] = $v; } } return $apps2; } function _get_settings() { return $this->base->get_setting(); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/uc_client/model/cache.php
PHP
asf20
2,206
<?php if(!defined('IN_DISCUZ')) { exit('Access Denied'); } define('DISCUZ_VERSION', '7.2'); define('DISCUZ_RELEASE', '20100110'); ?>
zyyhong
trunk/jiaju001/newbbs/bbs/discuz_version.php
PHP
asf20
145
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: post.php 21337 2010-01-06 08:09:58Z tiger $ */ define('CURSCRIPT', 'post'); define('NOROBOT', TRUE); require_once './include/common.inc.php'; require_once DISCUZ_ROOT.'./include/post.func.php'; $_DTYPE = $checkoption = $optionlist = array(); if($sortid) { threadsort_checkoption(); } if(empty($action)) { showmessage('undefined_action', NULL, 'HALTED'); }elseif($action == 'threadsorts') { threadsort_optiondata(); $template = intval($operate) ? 'search_sortoption' : 'post_sortoption'; include template($template); exit; } elseif(($forum['simple'] & 1) || $forum['redirect']) { showmessage('forum_disablepost'); } require_once DISCUZ_ROOT.'./include/discuzcode.func.php'; if($action == 'reply') { $addfeedcheck = $customaddfeed & 4 ? 'checked="checked"': ''; } elseif(!empty($special) && $action != 'reply') { $addfeedcheck = $customaddfeed & 2 ? 'checked="checked"': ''; } else { $addfeedcheck = $customaddfeed & 1 ? 'checked="checked"': ''; } $navigation = $navtitle = $thread = ''; if(!empty($cedit)) { unset($inajax, $infloat, $ajaxtarget, $handlekey); } if($action == 'edit' || $action == 'reply') { if($thread = $db->fetch_first("SELECT * FROM {$tablepre}threads WHERE tid='$tid'".($auditstatuson ? '' : " AND displayorder>='0'"))) { $navigation = "&raquo; <a href=\"viewthread.php?tid=$tid\">$thread[subject]</a>"; $navtitle = $thread['subject'].' - '; if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) { showmessage('thread_nopermission', NULL, 'NOPERM'); } $fid = $thread['fid']; $special = $thread['special']; } else { showmessage('thread_nonexistence'); } if($action == 'reply' && ($thread['closed'] == 1) && !$forum['ismoderator']) { showmessage('post_thread_closed'); } } $navigation = "&raquo; <a href=\"forumdisplay.php?fid=$fid".($extra ? '&'.preg_replace("/^(&)*/", '', $extra) : '')."\">$forum[name]</a> $navigation"; $navtitle = $navtitle.strip_tags($forum['name']).' - '; if($forum['type'] == 'sub') { $fup = $db->fetch_first("SELECT name, fid FROM {$tablepre}forums WHERE fid='$forum[fup]'"); $navigation = "&raquo; <a href=\"forumdisplay.php?fid=$fup[fid]\">$fup[name]</a> $navigation"; $navtitle = $navtitle.strip_tags($fup['name']).' - '; } periodscheck('postbanperiods'); if($forum['password'] && $forum['password'] != $_DCOOKIE['fidpw'.$fid]) { showmessage('forum_passwd', "forumdisplay.php?fid=$fid"); } if(empty($forum['allowview'])) { if(!$forum['viewperm'] && !$readaccess) { showmessage('group_nopermission', NULL, 'NOPERM'); } elseif($forum['viewperm'] && !forumperm($forum['viewperm'])) { showmessagenoperm('viewperm', $fid); } } elseif($forum['allowview'] == -1) { showmessage('forum_access_view_disallow'); } if($adminid != 1) { formulaperm($forum['formulaperm']); } if(!$adminid && $newbiespan && (!$lastpost || $timestamp - $lastpost < $newbiespan * 3600)) { if($timestamp - ($db->result_first("SELECT regdate FROM {$tablepre}members WHERE uid='$discuz_uid'")) < $newbiespan * 3600) { showmessage('post_newbie_span'); } } $special = $special > 0 && $special < 7 || $special == 127 ? intval($special) : 0; $allowpostattach = $forum['allowpostattach'] != -1 && ($forum['allowpostattach'] == 1 || (!$forum['postattachperm'] && $allowpostattach) || ($forum['postattachperm'] && forumperm($forum['postattachperm']))); $attachextensions = $forum['attachextensions'] ? $forum['attachextensions'] : $attachextensions; if($attachextensions) { $imgexts = explode(',', str_replace(' ', '', $attachextensions)); $imgexts = array_intersect(array('jpg','jpeg','gif','png','bmp'), $imgexts); $imgexts = implode(', ', $imgexts); } else { $imgexts = 'jpg, jpeg, gif, png, bmp'; } $allowuploadnum = TRUE; if($allowpostattach) { if($maxattachnum) { $allowuploadnum = $maxattachnum - $db->result_first("SELECT count(*) FROM {$tablepre}attachments WHERE uid='$discuz_uid' AND dateline>'$timestamp'-86400"); $allowuploadnum = $allowuploadnum < 0 ? 0 : $allowuploadnum; } if($maxsizeperday) { $allowuploadsize = $maxsizeperday - intval($db->result_first("SELECT SUM(filesize) FROM {$tablepre}attachments WHERE uid='$discuz_uid' AND dateline>'$timestamp'-86400")); $allowuploadsize = $allowuploadsize < 0 ? 0 : $allowuploadsize; $allowuploadsize = $allowuploadsize / 1048576 >= 1 ? round(($allowuploadsize / 1048576), 1).'MB' : round(($allowuploadsize / 1024)).'KB'; } } $allowpostimg = $allowpostattach && $imgexts; $enctype = $allowpostattach ? 'enctype="multipart/form-data"' : ''; $maxattachsize_mb = $maxattachsize / 1048576 >= 1 ? round(($maxattachsize / 1048576), 1).'MB' : round(($maxattachsize / 1024)).'KB'; $postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post']; $replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply']; $digestcredits = $forum['digestcredits'] ? $forum['digestcredits'] : $creditspolicy['digest']; $postattachcredits = $forum['postattachcredits'] ? $forum['postattachcredits'] : $creditspolicy['postattach']; $maxprice = isset($extcredits[$creditstrans]) ? $maxprice : 0; $extra = rawurlencode($extra); $notifycheck = empty($emailnotify) ? '' : 'checked="checked"'; $stickcheck = empty($sticktopic) ? '' : 'checked="checked"'; $digestcheck = empty($addtodigest) ? '' : 'checked="checked"'; $subject = isset($subject) ? dhtmlspecialchars(censor(trim($subject))) : ''; $subject = !empty($subject) ? str_replace("\t", ' ', $subject) : $subject; $message = isset($message) ? censor(trim($message)) : ''; $polloptions = isset($polloptions) ? censor(trim($polloptions)) : ''; $readperm = isset($readperm) ? intval($readperm) : 0; $price = isset($price) ? intval($price) : 0; $tagstatus = $tagstatus && $forum['allowtag'] ? ($tagstatus == 2 ? 2 : $forum['allowtag']) : 0; if(empty($bbcodeoff) && !$allowhidecode && !empty($message) && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message))) { showmessage('post_hide_nopermission'); } if(periodscheck('postmodperiods', 0)) { $modnewthreads = $modnewreplies = 1; } else { $censormod = censormod($subject."\t".$message); $modnewthreads = (!$allowdirectpost || $allowdirectpost == 1) && $forum['modnewposts'] || $censormod ? 1 : 0; $modnewreplies = (!$allowdirectpost || $allowdirectpost == 2) && $forum['modnewposts'] == 2 || $censormod ? 1 : 0; } if($allowposturl < 3 && $message) { $urllist = get_url_list($message); if(is_array($urllist[1])) foreach($urllist[1] as $key => $val) { if(!$val = trim($val)) continue; if(!iswhitelist($val)) { if($allowposturl == 0) { showmessage('post_url_nopermission'); } elseif($allowposturl == 1) { $modnewthreads = $modnewreplies = 1; break; } elseif($allowposturl == 2) { $message = str_replace('[url]'.$urllist[0][$key].'[/url]', $urllist[0][$key], $message); $message = preg_replace("@\[url={$urllist[0][$key]}\](.*?)\[/url\]@i", '\\1', $message); } } } } $urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = ''; if($discuz_uid) { if($db->result_first("SELECT COUNT(*) FROM {$tablepre}favoritethreads WHERE tid='$tid' AND uid='$discuz_uid'")) { $has_attention = true; } } $seccodecheck = ($seccodestatus & 4) && (!$seccodedata['minposts'] || $posts < $seccodedata['minposts']); $secqaacheck = $secqaa['status'][2] && (!$secqaa['minposts'] || $posts < $secqaa['minposts']); $allowpostpoll = $allowpost && $allowpostpoll && ($forum['allowpostspecial'] & 1); $allowposttrade = $allowpost && $allowposttrade && ($forum['allowpostspecial'] & 2); $allowpostreward = $allowpost && $allowpostreward && ($forum['allowpostspecial'] & 4) && isset($extcredits[$creditstrans]); $allowpostactivity = $allowpost && $allowpostactivity && ($forum['allowpostspecial'] & 8); $allowpostdebate = $allowpost && $allowpostdebate && ($forum['allowpostspecial'] & 16); $usesigcheck = $discuz_uid && $sigstatus ? 'checked="checked"' : ''; $ordertypecheck = getstatus($thread['status'], 4) ? 'checked="checked"' : ''; if($specialextra && $allowpost && $threadplugins && (!array_key_exists($specialextra, $threadplugins) || !@in_array($specialextra, unserialize($forum['threadplugin'])) || !@in_array($specialextra, $allowthreadplugin))) { $specialextra = ''; } $allowanonymous = $forum['allowanonymous'] || $allowanonymous ? 1 : 0; if($action == 'newthread' && $forum['allowspecialonly'] && !$special) { if($allowpostpoll) { $special = 1; } elseif($allowposttrade) { $special = 2; } elseif($allowpostreward) { $special = 3; } elseif($allowpostactivity) { $special = 4; } elseif($allowpostdebate) { $special = 5; } elseif($allowpost && $threadplugins && $allowthreadplugin && ($forum['threadplugin'] = unserialize($forum['threadplugin']))) { $threadpluginary = array_intersect($allowthreadplugin, $forum['threadplugin']); $specialextra = $threadpluginary[0] ? $threadpluginary[0] : ''; } if(!$special && !$specialextra) { showmessage('undefined_action', NULL, 'HALTED'); } } $editorid = 'e'; $editoroptions = str_pad(decbin($editoroptions), 2, 0, STR_PAD_LEFT); $editormode = $editormode == 2 ? $editoroptions{0} : $editormode; $allowswitcheditor = $editoroptions{1}; if($specialextra) { $special = 127; if(@in_array($specialextra, $pluginlangs)) { @include_once DISCUZ_ROOT.'./forumdata/cache/cache_scriptlang.php'; } } if($action == 'newthread') { $policykey = 'post'; } elseif($action == 'reply') { $policykey = 'reply'; } else { $policykey = ''; } if($policykey) { $postcredits = $forum[$policykey.'credits'] ? $forum[$policykey.'credits'] : $creditspolicy[$policykey]; } $posturl = "action=$action&fid=$fid". (!empty($tid) ? "&tid=$tid" : ''). (!empty($pid) ? "&pid=$pid" : ''). (!empty($special) ? "&special=$special" : ''). (!empty($sortid) ? "&sortid=$sortid" : ''). (!empty($typeid) ? "&sortid=$typeid" : ''). (!empty($firstpid) ? "&firstpid=$firstpid" : ''). (!empty($addtrade) ? "&addtrade=$addtrade" : ''); print_r($_COOKIE); if($action == 'newthread') { ($forum['allowpost'] == -1) && showmessage('forum_access_disallow'); require_once DISCUZ_ROOT.'./include/newthread.inc.php'; } elseif($action == 'reply') { ($forum['allowreply'] == -1) && showmessage('forum_access_disallow'); require_once DISCUZ_ROOT.'./include/newreply.inc.php'; } elseif($action == 'edit') { ($forum['allowpost'] == -1) && showmessage('forum_access_disallow'); require_once DISCUZ_ROOT.'./include/editpost.inc.php'; } elseif($action == 'newtrade') { ($forum['allowpost'] == -1) && showmessage('forum_access_disallow'); require_once DISCUZ_ROOT.'./include/newtrade.inc.php'; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/post.php
PHP
asf20
11,097
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: topic.php 16688 2008-11-14 06:41:07Z cnteacher $ */ define('CURSCRIPT', 'topic'); require_once './include/common.inc.php'; $randnum = !empty($qihoo['relate']['webnum']) ? rand(1, 1000) : ''; $statsdata = $statsdata ? dhtmlspecialchars($statsdata) : ''; if($url && $randnum) { $url = dhtmlspecialchars($url); $md5 = dhtmlspecialchars($md5); $fid = substr($statsdata, 0, strpos($statsdata, '||')); } else { if(empty($keyword)) { showmessage('undefined_action'); } $tpp = intval($tpp); $page = max(1, intval($page)); $start = ($page - 1) * $tpp; $site = site(); $length = intval($length); $stype = empty($stype) ? 0 : 'title'; $relate = in_array($relate, array('score', 'pdate', 'rdate')) ? $relate : 'score'; $keyword = dhtmlspecialchars(stripslashes($keyword)); $topic = $topic ? dhtmlspecialchars(stripslashes($topic)) : $keyword; } include template('topic'); ?>
zyyhong
trunk/jiaju001/newbbs/bbs/topic.php
PHP
asf20
1,047
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: my.php 21055 2009-11-10 00:33:11Z monkey $ */ define('NOROBOT', TRUE); define('CURSCRIPT', 'my'); require_once './include/common.inc.php'; require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php'; require_once DISCUZ_ROOT.'./include/forum.func.php'; if($my_status && $from) { $funcstatinfo[] = 'manyou2dz,20090727'; } $discuz_action = 8; if(!$discuz_uid) { showmessage('not_loggedin', NULL, 'NOPERM'); } $page = max(1, intval($page)); $start_limit = ($page - 1) * $tpp; $threadlist = $postlist = array(); $tids = $comma = $threadadd = $postadd = $forumname =$uidadd = $extrafid = $extra = $multipage = ''; if($srchfid = empty($srchfid) ? 0 : intval($srchfid)) { $threadadd = "AND t.fid='$srchfid'"; $postadd = "AND p.fid='$srchfid'"; $forumname = $_DCACHE['forums'][$srchfid]['name']; $extrafid = '&amp;srchfid='.$srchfid; } $forumselect = forumselect(FALSE, 0, $srchfid); $item = isset($item) ? trim($item) : ''; $uid = !empty($uid) && $uid != $discuz_uid && $allowviewuserthread ? $uid : 0; if($uid) { if(!$allowviewpro) { showmessage('group_nopermission', NULL, 'NOPERM'); } $member = $db->fetch_first("SELECT username FROM {$tablepre}members WHERE uid='$uid'"); if(!$member) { header("HTTP/1.0 404 Not Found"); showmessage('member_nonexistence'); } $uidadd = '&amp;uid='.$uid; } if(empty($item) || $item == 'threads') { if($uid) { $threadadd .= " AND fid IN ($allowviewuserthread)"; $srchuid = $uid; $filter = ''; } else { $srchuid = $discuz_uid; } if($filter == 'recyclebin') { $threadadd .= " AND displayorder='-1'"; } elseif($filter == 'aduit') { $threadadd .= " AND displayorder='-2'"; } elseif($filter == 'close') { $threadadd .= " AND closed='1'"; } elseif($filter == 'common') { $threadadd .= " AND displayorder>='0' AND closed='0'"; } $fidadd = $srchfid ? "&amp;srchfid=$srchfid" : ''; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads t WHERE authorid='$srchuid' $threadadd"); $multipage = multi($num, $tpp, $page, 'my.php?item=threads'.$uidadd.$fidadd.$extrafid); $query = $db->query("SELECT * FROM {$tablepre}threads t WHERE authorid='$srchuid' $threadadd ORDER BY dateline DESC LIMIT $start_limit, $tpp"); require_once DISCUZ_ROOT.'./include/misc.func.php'; while($thread = $db->fetch_array($query)) { $threadlist[] = procthread($thread); } } elseif($item == 'posts') { if($uid) { $threadadd .= " AND t.fid IN ($allowviewuserthread)"; $srchuid = $uid; $filter = ''; } else { $srchuid = $discuz_uid; } if($filter == 'recyclebin') { $postadd .= " AND p.invisible='-1'"; } elseif($filter == 'aduit') { $postadd .= " AND p.invisible='-2'"; } elseif($filter == 'close') { $threadadd .= " AND t.closed='1'"; } elseif($filter == 'common') { $postadd .= " AND p.invisible='0'"; $threadadd .= " AND t.displayorder>='0' AND t.closed='0'"; } $fidadd = $srchfid ? "&amp;srchfid=$srchfid" : ''; require_once DISCUZ_ROOT.'./include/post.func.php'; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}posts p INNER JOIN {$tablepre}threads t ON t.tid=p.tid $threadadd WHERE p.authorid='$srchuid' $postadd"); $multipage = multi($num, $tpp, $page, 'my.php?item=posts'.$uidadd.$fidadd.$extrafid); $query = $db->query("SELECT p.authorid, p.tid, p.pid, p.fid, p.invisible, p.dateline, p.message, t.status FROM {$tablepre}posts p INNER JOIN {$tablepre}threads t ON t.tid=p.tid $threadadd WHERE p.authorid='$srchuid' $postadd ORDER BY p.dateline DESC LIMIT $start_limit, $tpp"); $tids = $threads = array(); while($post = $db->fetch_array($query)) { $hiddenreplies = $srchuid == $discuz_uid ? 0 : getstatus($post['status'], 2); $post['dateline'] = dgmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600); $post['forumname'] = $_DCACHE['forums'][$post['fid']]['name']; $post['message'] = !$hiddenreplies ? messagecutstr($post['message'], 100) : ''; $postlist[] = $post; $tids[$post['tid']] = $post['tid']; } if($tids) { require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT * FROM {$tablepre}threads WHERE tid IN (".implodeids($tids).")"); while($thread = $db->fetch_array($query)) { $threads[$thread['tid']] = procthread($thread); } } } elseif($item == 'favorites') { if($fid && empty($forum['allowview'])) { if(!$forum['viewperm'] && !$readaccess) { showmessage('group_nopermission', NULL, 'NOPERM'); } elseif($forum['viewperm'] && !forumperm($forum['viewperm'])) { showmessage('forum_nopermission', NULL, 'NOPERM'); } } $ftid = $type == 'thread' || $tid ? 'tid' : 'fid'; $type = $type == 'thread' || $tid ? 'thread' : 'forum'; $extra .= $srchfid ? '&amp;type='.$type : ''; $action = empty($action) ? '' : $action; if($action == 'remove' && ($tid || $fid)) { if($tid) { $db->query("DELETE FROM {$tablepre}favorites WHERE uid='$discuz_uid' AND tid='$tid'", 'UNBUFFERED'); showmessage('favorite_remove_thread_succeed', dreferer()); } else { $db->query("DELETE FROM {$tablepre}favorites WHERE uid='$discuz_uid' AND fid='$fid'", 'UNBUFFERED'); showmessage('favorite_remove_forum_succeed', dreferer()); } } elseif(($fid || $tid) && !submitcheck('favsubmit')) { if($db->result_first("SELECT $ftid FROM {$tablepre}favorites WHERE uid='$discuz_uid' AND $ftid='${$ftid}' LIMIT 1")) { if($tid) { showmessage('favorite_thread_exists'); } else { showmessage('favorite_forum_exists'); } } else { $db->query("INSERT INTO {$tablepre}favorites (uid, $ftid) VALUES ('$discuz_uid', '${$ftid}')"); if($tid) { showmessage('favorite_add_thread_succeed', dreferer()); } else { showmessage('favorite_add_forum_succeed', dreferer()); } } } elseif(!$fid && !$tid) { if(!submitcheck('favsubmit')) { $favlist = array(); if($type == 'forum') { $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}favorites fav, {$tablepre}forums f WHERE fav.uid = '$discuz_uid' AND fav.fid=f.fid"); $multipage = multi($num, $tpp, $page, "my.php?item=favorites&amp;type=forum$extrafid"); $query = $db->query("SELECT f.fid, f.name, f.threads, f.posts, f.todayposts, f.lastpost FROM {$tablepre}favorites fav, {$tablepre}forums f WHERE fav.fid=f.fid AND fav.uid='$discuz_uid' ORDER BY f.lastpost DESC LIMIT $start_limit, $tpp"); while($fav = $db->fetch_array($query)) { $fav['lastposterenc'] = rawurlencode($fav['lastposter']); $fav['lastpost'] = dgmdate("$dateformat $timeformat", $fav['lastpost'] + $timeoffset * 3600); $favlist[] = $fav; } } else { $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}favorites fav, {$tablepre}threads t WHERE fav.uid = '$discuz_uid' AND fav.tid=t.tid AND t.displayorder>='0' $threadadd"); $multipage = multi($num, $tpp, $page, "my.php?item=favorites&amp;type=thread$extrafid"); $query = $db->query("SELECT t.tid, t.fid, t.subject, t.replies, t.lastpost, t.lastposter, f.name FROM {$tablepre}favorites fav, {$tablepre}threads t, {$tablepre}forums f WHERE fav.tid=t.tid AND t.displayorder>='0' AND fav.uid='$discuz_uid' AND t.fid=f.fid $threadadd ORDER BY t.lastpost DESC LIMIT $start_limit, $tpp"); while($fav = $db->fetch_array($query)) { $fav['lastposterenc'] = rawurlencode($fav['lastposter']); $fav['lastpost'] = dgmdate("$dateformat $timeformat", $fav['lastpost'] + $timeoffset * 3600); $favlist[] = $fav; } } } else { if($ids = implodeids($delete)) { $db->query("DELETE FROM {$tablepre}favorites WHERE uid='$discuz_uid' AND $ftid IN ($ids)", 'UNBUFFERED'); write_statlog('', 'item=favorites&action=deletefav', '', '', 'my.php'); } showmessage('favorite_update_succeed', dreferer()); } } } elseif($item == 'selltrades' || $item == 'buytrades') { require_once DISCUZ_ROOT.'./include/trade.func.php'; include_once language('misc'); $sqlfield = $item == 'selltrades' ? 'sellerid' : 'buyerid'; $sqlfilter = ''; switch($filter) { case 'attention': $typestatus = $item; break; case 'eccredit' : $typestatus = 'eccredittrades'; $sqlfilter .= $item == 'selltrades' ? 'AND (tl.ratestatus=0 OR tl.ratestatus=1) ' : 'AND (tl.ratestatus=0 OR tl.ratestatus=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'; $filter = ''; } $sqlfilter .= $typestatus ? 'AND tl.status IN (\''.trade_typestatus($typestatus).'\')' : ''; if(!empty($srchkey)) { $sqlkey = 'AND tl.subject like \'%'.str_replace('*', '%', addcslashes($srchkey, '%_')).'%\''; $extrasrchkey = '&srchkey='.rawurlencode($srchkey); $srchkey = dhtmlspecialchars($srchkey); } else { $sqlkey = $extrasrchkey = $srchkey = ''; } $pid = intval($pid); $sqltid = $tid ? 'AND tl.tid=\''.$tid.'\''.($pid ? ' AND tl.pid=\''.$pid.'\'' : '') : ''; $extra .= $srchfid ? '&amp;filter='.$filter : ''; $extratid = $tid ? "&amp;tid=$tid".($pid ? "&amp;pid=$pid" : '') : ''; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}tradelog tl, {$tablepre}threads t WHERE tl.tid=t.tid AND tl.$sqlfield='$discuz_uid' $threadadd $sqltid $sqlkey $sqlfilter"); $multipage = multi($num, $tpp, $page, "my.php?item=$item$extratid$extrafid".($filter ? "&amp;filter=$filter" : '').$extrafid.$extrasrchkey); $query = $db->query("SELECT tl.*, tr.aid, t.subject AS threadsubject FROM {$tablepre}tradelog tl, {$tablepre}threads t, {$tablepre}trades tr WHERE tl.tid=t.tid AND tr.pid=tl.pid AND tr.tid=tl.tid AND tl.$sqlfield='$discuz_uid' $threadadd $sqltid $sqlkey $sqlfilter ORDER BY tl.lastupdate DESC LIMIT $start_limit, $tpp"); $tradeloglist = array(); while($tradelog = $db->fetch_array($query)) { $tradelog['lastupdate'] = dgmdate("$dateformat $timeformat", $tradelog['lastupdate'] + $timeoffset * 3600); $tradelog['attend'] = trade_typestatus($item, $tradelog['status']); $tradelog['status'] = trade_getstatus($tradelog['status']); $tradeloglist[] = $tradelog; } } elseif($item == 'tradestats') { $extrasrchkey = $extratid = ''; require_once DISCUZ_ROOT.'./include/trade.func.php'; $buystats = $db->fetch_first("SELECT COUNT(*) AS totalitems, SUM(price) AS tradesum FROM {$tablepre}tradelog WHERE buyerid='$discuz_uid' AND status IN ('".trade_typestatus('successtrades')."')"); $sellstats = $db->fetch_first("SELECT COUNT(*) AS totalitems, SUM(price) AS tradesum FROM {$tablepre}tradelog WHERE sellerid='$discuz_uid' AND status IN ('".trade_typestatus('successtrades')."')"); $query = $db->query("SELECT status FROM {$tablepre}tradelog WHERE buyerid='$discuz_uid' AND status IN ('".trade_typestatus('buytrades')."')"); $buyerattend = $db->num_rows($query); $attendstatus = array(); while($status = $db->fetch_array($query)) { @$attendstatus[$status['status']]++; } $query = $db->query("SELECT status FROM {$tablepre}tradelog WHERE sellerid='$discuz_uid' AND status IN ('".trade_typestatus('selltrades')."')"); $sellerattend = $db->num_rows($query); while($status = $db->fetch_array($query)) { @$attendstatus[$status['status']]++; } $goodsbuyer = $db->result_first("SELECT COUNT(*) FROM {$tablepre}tradelog WHERE buyerid='$discuz_uid' AND status IN ('".trade_typestatus('tradingtrades')."')"); $goodsseller = $db->result_first("SELECT COUNT(*) FROM {$tablepre}trades WHERE sellerid='$discuz_uid' AND closed='0'"); $eccreditbuyer = $db->result_first("SELECT COUNT(*) FROM {$tablepre}tradelog WHERE status IN ('".trade_typestatus('eccredittrades')."') AND buyerid='$discuz_uid' AND (ratestatus=0 OR ratestatus=2)"); $eccreditseller = $db->result_first("SELECT COUNT(*) FROM {$tablepre}tradelog WHERE status IN ('".trade_typestatus('eccredittrades')."') AND sellerid='$discuz_uid' AND (ratestatus=0 OR ratestatus=1)"); } elseif($item == 'tradethreads') { if(!empty($srchkey)) { $sqlkey = 'AND subject like \'%'.str_replace('*', '%', addcslashes($srchkey, '%_')).'%\''; $extrasrchkey = '&srchkey='.rawurlencode($srchkey); $srchkey = dhtmlspecialchars($srchkey); } else { $sqlkey = $extrasrchkey = $srchkey = ''; } $sqltid = $tid ? 'AND tid ='.$tid : ''; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}trades WHERE sellerid='$discuz_uid' $sqltid $sqlkey"); $extratid = $tid ? "&amp;tid=$tid" : ''; $multipage = multi($num, $tpp, $page, "my.php?item=tradethreads$extratid$extrafid$extrasrchkey"); $tradelist = array(); $query = $db->query("SELECT * FROM {$tablepre}trades WHERE sellerid='$discuz_uid' $sqltid $sqlkey ORDER BY tradesum DESC, totalitems DESC LIMIT $start_limit, $tpp"); while($tradethread = $db->fetch_array($query)) { $tradethread['lastupdate'] = dgmdate("$dateformat $timeformat", $tradethread['lastupdate'] + $timeoffset * 3600); $tradethread['lastbuyer'] = rawurlencode($tradethread['lastbuyer']); if($tradethread['expiration']) { $tradethread['expiration'] = ($tradethread['expiration'] - $timestamp) / 86400; if($tradethread['expiration'] > 0) { $tradethread['expirationhour'] = floor(($tradethread['expiration'] - floor($tradethread['expiration'])) * 24); $tradethread['expiration'] = floor($tradethread['expiration']); } else { $tradethread['expiration'] = -1; } } $tradelist[] = $tradethread; } } elseif($item == 'reward') { $rewardloglist = Array(); if($type == 'stats') { $questions = $db->fetch_first("SELECT COUNT(*) AS total, SUM(ABS(netamount)) AS totalprice FROM {$tablepre}rewardlog WHERE authorid='$discuz_uid'"); $questions['total'] = $questions['total'] ? $questions['total'] : 0; $questions['totalprice'] = $questions['totalprice'] ? $questions['totalprice'] : 0; $questions['solved'] = $db->result_first("SELECT COUNT(*) FROM {$tablepre}rewardlog WHERE authorid='$discuz_uid' and answererid>0"); $questions['percent'] = number_format(($questions['total'] != 0) ? round($questions['solved'] / $questions['total'] * 100, 2) : 0, 2, '.', ''); $answers['total'] = $db->result_first("SELECT COUNT(*) FROM {$tablepre}rewardlog WHERE answererid='$discuz_uid'"); $answeradopted = $db->fetch_first("SELECT COUNT(*) AS tids, SUM(ABS(t.price)) AS totalprice FROM {$tablepre}rewardlog r LEFT JOIN {$tablepre}threads t USING(tid) WHERE r.authorid>0 and r.answererid='$discuz_uid'"); $answers['adopted'] = $answeradopted['tids']; $answers['totalprice'] = $answeradopted['totalprice'] ? $answeradopted['totalprice'] : 0; $answers['percent'] = number_format(($answers['total'] != 0) ? round($answers['adopted'] / $answers['total'] * 100, 2) : 0, 2, '.', ''); } elseif($type == 'answer') { $extra .= $srchfid ? '&amp;type=answer' : ''; $filter = isset($filter) && in_array($filter, array('adopted', 'unadopted')) ? $filter : ''; $sqlfilter = empty($filter) ? '' : ($filter == 'adopted' ? 'AND r.authorid>0' : 'AND r.authorid=0'); $page = max(1, intval($page)); $start_limit = ($page - 1) * $tpp; $multipage = multi($db->result_first("SELECT COUNT(*) FROM {$tablepre}rewardlog r WHERE answererid='$discuz_uid'"), $tpp, $page, "my.php?item=reward&amp;type=answer$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT r.*, t.*, m.uid, m.username, f.fid, f.name FROM {$tablepre}rewardlog r LEFT JOIN {$tablepre}threads t ON t.tid=r.tid LEFT JOIN {$tablepre}forums f ON f.fid=t.fid LEFT JOIN {$tablepre}members m ON m.uid=t.authorid WHERE r.answererid='$discuz_uid' $threadadd $sqlfilter ORDER BY r.dateline DESC LIMIT $start_limit, $tpp"); while($rewardlog = $db->fetch_array($query)) { $rewardlog['price'] = abs($rewardlog['price']); $rewardloglist[] = procthread($rewardlog); } } elseif($type == 'question') { $extra .= $srchfid ? '&amp;type=question' : ''; $filter = in_array($filter, array('solved', 'unsolved')) ? $filter : ''; $sqlfilter = empty($filter) ? '' : ($filter == 'solved' ? 'AND r.answererid>0' : 'AND r.answererid=0'); $page = max(1, intval($page)); $start_limit = ($page - 1) * $tpp; $multipage = multi($db->result_first("SELECT COUNT(*) FROM {$tablepre}rewardlog r WHERE authorid='$discuz_uid' $sqlfilter"), $tpp, $page, "my.php?item=reward&amp;type=question&amp;filter=$filter$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT r.*, t.*, m.uid, m.username, f.fid, f.name FROM {$tablepre}rewardlog r LEFT JOIN {$tablepre}threads t ON t.tid=r.tid LEFT JOIN {$tablepre}forums f ON f.fid=t.fid LEFT JOIN {$tablepre}members m ON m.uid=r.answererid WHERE r.authorid='$discuz_uid' $threadadd $sqlfilter ORDER BY r.dateline DESC LIMIT $start_limit, $tpp"); while($rewardlog = $db->fetch_array($query)) { $rewardlog['price'] = abs($rewardlog['price']); $rewardloglist[] = procthread($rewardlog); } } else { showmessage('undefined_action'); } } elseif($item == 'activities') { $ended = isset($ended) && in_array($ended, array('yes', 'no')) ? $ended : ''; $sign = $ascadd = ''; $activity = array(); if($type == 'orig') { if($ended == 'yes') { $sign = " AND starttimefrom<'$timestamp'"; $ascadd = 'DESC'; } elseif($ended == 'no') { $sign = " AND starttimefrom>='$timestamp'"; } $extra .= $srchfid ? '&amp;type=orig' : ''; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}activities a LEFT JOIN {$tablepre}threads t USING(tid) WHERE a.uid='$discuz_uid' AND t.special='4' $threadadd $sign"); $multipage = multi($num, $tpp, $page, "my.php?item=activities&amp;type=orig&amp;ended=$ended$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT a.*, t.* FROM {$tablepre}activities a LEFT JOIN {$tablepre}threads t USING(tid) WHERE a.uid='$discuz_uid' AND t.special='4' $threadadd $sign ORDER BY starttimefrom $ascadd LIMIT $start_limit, $tpp"); while($tempact = $db->fetch_array($query)) { $tempact['starttimefrom'] = dgmdate("$dateformat $timeformat", $tempact['starttimefrom'] + $timeoffset * 3600); $activity[] = procthread($tempact); } } else { if($ended == 'yes') { $sign = " AND verified='1'"; } elseif($ended == 'no') { $sign = " AND verified='0'"; } $extra .= $srchfid ? '&amp;type='.$type : ''; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}activityapplies aa LEFT JOIN {$tablepre}activities a USING(tid) LEFT JOIN {$tablepre}threads t USING(tid) WHERE a.uid='$discuz_uid' $threadadd$sign"); $multipage = multi($num, $tpp, $page, "my.php?item=activities&amp;type=apply&amp;ended=$ended$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT aa.verified, aa.tid, starttimefrom, a.place, a.cost, t.* FROM {$tablepre}activityapplies aa LEFT JOIN {$tablepre}activities a USING(tid) LEFT JOIN {$tablepre}threads t USING(tid) WHERE aa.uid='$discuz_uid' $threadadd$sign ORDER BY starttimefrom $ascadd LIMIT $start_limit, $tpp"); while($tempact = $db->fetch_array($query)) { $tempact['starttimefrom'] = dgmdate("$dateformat $timeformat", $tempact['starttimefrom'] + $timeoffset * 3600); $activity[] = procthread($tempact); } } } elseif($item == 'polls'){ $polllist = array(); if($srchfid = intval($srchfid)) { $threadadd = "AND fid='$srchfid'"; } $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads t WHERE t.authorid='$discuz_uid' AND t.special='1' $threadadd"); $multipage = multi($num, $tpp, $page, "my.php?item=polls&amp;type=poll$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT t.* FROM {$tablepre}threads t WHERE t.authorid='$discuz_uid' AND t.special='1' $threadadd ORDER BY t.dateline DESC LIMIT $start_limit, $tpp"); while($poll = $db->fetch_array($query)) { $poll['lastposterenc'] = rawurlencode($poll['lastposter']); $poll['forumname'] = $_DCACHE['forums'][$poll['fid']]['name']; $polllist[] = procthread($poll); } } elseif($item == 'promotion' && ($creditspolicy['promotion_visit'] || $creditspolicy['promotion_register'])) { $promotion_visit = $promotion_register = $space = ''; foreach(array('promotion_visit', 'promotion_register') as $val) { if(!empty($creditspolicy[$val]) && is_array($creditspolicy[$val])) { foreach($creditspolicy[$val] as $id => $policy) { $$val .= $space.$extcredits[$id]['title'].' +'.$policy; $space = '&nbsp;'; } } } } elseif($item == 'debate') { $debatelist = array(); if($filter == 'recyclebin') { $threadadd .= " AND t.displayorder='-1'"; } elseif($filter == 'aduit') { $threadadd .= " AND t.displayorder='-2'"; } elseif($filter == 'close') { $threadadd .= " AND t.closed='1'"; } elseif($filter == 'common') { $threadadd .= " AND t.displayorder>='0' AND t.closed='0'"; } if($type == 'orig') { $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads t WHERE t.authorid='$discuz_uid' AND t.special='5' $threadadd"); $multipage = multi($num, $tpp, $page, "my.php?item=debate&amp;type=orig$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT t.* FROM {$tablepre}threads t WHERE t.authorid='$discuz_uid' AND t.special='5' $threadadd ORDER BY t.dateline DESC LIMIT $start_limit, $tpp"); while($debate = $db->fetch_array($query)) { $debate['lastposterenc'] = rawurlencode($debate['lastposter']); $debate['forumname'] = $_DCACHE['forums'][$debate['fid']]['name']; $debatelist[] = procthread($debate); } } elseif($type == 'reply') { require_once DISCUZ_ROOT.'./include/post.func.php'; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}posts p, {$tablepre}threads t WHERE p.authorid='$discuz_uid' AND p.tid=t.tid AND t.special='5' $threadadd"); $multipage = multi($num, $tpp, $page, "my.php?item=debate&amp;type=reply$extrafid"); require_once DISCUZ_ROOT.'./include/misc.func.php'; $query = $db->query("SELECT p.pid, p.message, t.dateline, t.* FROM {$tablepre}posts p, {$tablepre}threads t WHERE p.authorid='$discuz_uid' AND p.first='0' AND p.tid=t.tid AND t.special='5' $threadadd ORDER BY p.dateline DESC LIMIT $start_limit, $tpp"); while($debate = $db->fetch_array($query)) { $debate['message'] = messagecutstr($debate['message'], 100); $debate['forumname'] = $_DCACHE['forums'][$debate['fid']]['name']; $debatelist[] = procthread($debate); } } } elseif($item == 'buddylist') { include_once DISCUZ_ROOT.'./uc_client/client.php'; $buddynum = 999; $extratype = empty($type) ? '' : '&type=fans'; if(!submitcheck('buddysubmit', 1)) { $buddylist = array(); $friendtype = empty($type) ? 3 : 1; $buddynum = uc_friend_totalnum($discuz_uid, $friendtype); $buddies = $buddynum ? uc_friend_ls($discuz_uid, $page, $tpp, $buddynum, $friendtype) : array(); $multipage = multi($buddynum, $tpp, $page, "my.php?item=buddylist$extratype"); if($buddies) { foreach($buddies as $key => $buddy) { $buddylist[$buddy['friendid']] = $buddy; } unset($buddies); $query = $db->query("SELECT m.uid, m.gender, mf.msn, s.uid AS online FROM {$tablepre}members m LEFT JOIN {$tablepre}sessions s ON s.uid=m.uid LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid WHERE m.uid IN (".implodeids(array_keys($buddylist)).")"); while($member = $db->fetch_array($query)) { if(isset($buddylist[$member['uid']])) { $buddylist[$member['uid']]['avatar'] = discuz_uc_avatar($member['uid'], 'small'); $buddylist[$member['uid']]['gender'] = $member['gender']; $buddylist[$member['uid']]['online'] = $member['online']; $buddylist[$member['uid']]['msn'] = explode("\t", $member['msn']); } else { unset($buddylist[$member['uid']]); } } } } else { $buddyarray = uc_friend_ls($discuz_uid, 1, $buddynum, $buddynum); if($action == 'edit') { if($comment = cutstr(dhtmlspecialchars($comment), 255)) { $friendid = intval($friendid); uc_friend_delete($discuz_uid, array($friendid)); uc_friend_add($discuz_uid, $friendid, $comment); } } elseif($action == 'delete') { $friendid = intval($friendid); uc_friend_delete($discuz_uid, array($friendid)); manyoulog('friend', $discuz_uid, 'delete', $friendid); } else { $buddyarraynew = array(); if($buddyarray) { foreach($buddyarray as $buddy) { $buddyarraynew[$buddy['friendid']] = $buddy; } } $buddyarray = $buddyarraynew;unset($buddyarraynew); if(($newbuddy && $newbuddy != $discuz_userss) || ($newbuddyid && $newbuddyid != $discuz_uid)) { $newbuddyid && $newbuddy = $db->result_first("SELECT username FROM {$tablepre}members WHERE uid='$newbuddyid'", 0); if($buddyid = uc_get_user($newbuddy)) { if(isset($buddyarray[$buddyid[0]])) { showmessage('buddy_add_invalid'); } if(uc_friend_add($discuz_uid, $buddyid[0], cutstr(dhtmlspecialchars($newdescription), 255))) { if($my_status) { $manyoufriend = FALSE; $buddyarray = uc_friend_ls($discuz_uid, 1, $buddynum, $buddynum, 3); foreach($buddyarray as $buddy) { if($buddyid[0] == $buddy['friendid']) { $manyoufriend = TRUE; break; } } if($manyoufriend) { manyoulog('friend', $discuz_uid, 'add', $buddyid[0]); manyoulog('friend', $buddyid[0], 'add', $discuz_uid); } } if($ucappopen['UCHOME']) { sendnotice($buddyid[0], 'buddy_new_uch', 'friend'); } else { sendnotice($buddyid[0], 'buddy_new', 'friend'); } if($prompts['newbietask'] && $newbietaskid && $newbietasks[$newbietaskid]['scriptname'] == 'addbuddy') { require_once DISCUZ_ROOT.'./include/task.func.php'; task_newbie_complete(); } } else { showmessage('buddy_add_ignore'); } } else { showmessage('username_nonexistence'); } } } showmessage('buddy_update_succeed', 'my.php?item=buddylist'.$extratype); } } elseif($item == 'attention') { if(!submitcheck('attentionsubmit')) { $type = !$type ? 'thread' : $type; if($type == 'forum') { if($action == 'add') { if($db->result_first("SELECT COUNT(*) FROM {$tablepre}favoriteforums WHERE fid='$fid' AND uid='$discuz_uid'")) { showmessage('favoriteforums_exists', dreferer()); } $timestamp = time(); $db->query("REPLACE INTO {$tablepre}favoriteforums (fid, uid, dateline) VALUES ('$fid', '$discuz_uid', '$timestamp')"); showmessage('favoriteforums_add_succeed', dreferer()); } elseif($action == 'remove') { $db->query("DELETE FROM {$tablepre}favoriteforums WHERE fid='$fid' AND uid='$discuz_uid'"); showmessage('favoriteforums_remove_succeed', dreferer()); } elseif($action == 'detail') { $theforum = $db->fetch_first("SELECT * FROM {$tablepre}forums WHERE fid='$fid'"); $newthreads = array(); $num_dateline = $db->fetch_first("SELECT newthreads, dateline FROM {$tablepre}favoriteforums WHERE fid='$fid' AND uid='$discuz_uid'"); $num = $num_dateline['newthreads']; $dateline = $num_dateline['dateline']; $multipage = multi($num, $tpp, $page, 'my.php?item=attention&action=detail&type=forum'); $query = $db->query("SELECT tid, fid, author, authorid, subject, dateline, lastpost, lastposter, views, replies FROM {$tablepre}threads WHERE fid='$fid' AND authorid<>'$discuz_uid' AND dateline>$dateline ORDER BY dateline LIMIT $start_limit, $tpp"); $newthreads = array(); while($newthread = $db->fetch_array($query)) { $newthread['forumname'] = $_DCACHE['forums'][$newthread['fid']]['name']; $newthread['dateline'] = dgmdate("$dateformat $timeformat", $newthread['dateline'] + $timeoffset * 3600); $newthread['lastpost'] = dgmdate("$dateformat $timeformat", $newthread['lastpost'] + $timeoffset * 3600); $newthreads[] = $newthread; } $db->query("UPDATE {$tablepre}favoriteforums SET newthreads=0, dateline='$timestamp' WHERE fid='$fid' AND uid='$discuz_uid'"); } elseif($action == 'open') { $db->query("UPDATE {$tablepre}favoriteforums SET dateline='$timestamp', newthreads=0 WHERE fid='$fid' AND uid='$discuz_uid'"); dheader("Location: forumdisplay.php?fid=$fid"); } else { $sqladd = ''; if($filter == 'new') { $sqladd .= "AND ff.newthreads>0"; } $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}favoriteforums ff WHERE ff.uid='$discuz_uid' $sqladd"); $filteradd = $filter ? "&filter=$filter" : ''; $multipage = multi($num, $tpp, $page, 'my.php?item=attention&type=forum'.$fiteradd); $query = $db->query("SELECT ff.*, f.fid f_fid, f.name, f.threads, f.posts, f.lastpost, f.todayposts FROM {$tablepre}favoriteforums ff LEFT JOIN {$tablepre}forums f ON ff.fid=f.fid WHERE ff.uid='$discuz_uid' $sqladd ORDER BY f.displayorder LIMIT $start_limit, $tpp"); $attentionlist = array(); while($attention = $db->fetch_array($query)) { if(!$attention['f_fid']) { $db->query("DELETE FROM {$tablepre}favoriteforums WHERE fid='$attention[fid]' AND uid='$discuz_uid'"); continue; } $lastpost = array(); list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = explode("\t", $attention['lastpost']); $lastpost['dateline'] = dgmdate("$dateformat $timeformat", $lastpost['dateline'] + $timeoffset * 3600); $attention['lastpost'] = $lastpost; $attentionlist[] = $attention; } } } else { if($tid && $action == 'add') { if($db->result_first("SELECT COUNT(*) FROM {$tablepre}favoritethreads WHERE tid='$tid' AND uid='$discuz_uid'")) { showmessage('favoritethreads_exists', dreferer()); } $timestamp = time(); $attention_exists = $db->result_first("SELECT COUNT(*) FROM {$tablepre}favoritethreads WHERE tid='$tid' AND uid='$discuz_uid'"); $db->query("REPLACE INTO {$tablepre}favoritethreads (tid, uid, dateline) VALUES ('$tid', '$discuz_uid', '$timestamp')", 'UNBUFFERED'); showmessage('favoritethreads_add_succeed', dreferer()); } elseif($action == 'remove') { $db->query("DELETE FROM {$tablepre}favoritethreads WHERE tid='$tid' AND uid='$discuz_uid'"); showmessage('favoritethreads_remove_succeed', dreferer()); } $sqladd = ''; if($filter == 'new') { $sqladd .= " AND ft.newreplies>0"; } $filteradd = $filter ? "&filter=$filter" : ''; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}favoritethreads ft WHERE ft.uid='$discuz_uid' $sqladd"); $multipage = multi($num, $tpp, $page, 'my.php?item=attention'.$filteradd); $query = $db->query("SELECT t.tid AS t_tid, t.fid, t.subject, t.replies, t.lastpost, t.lastposter, ft.* FROM {$tablepre}favoritethreads ft LEFT JOIN {$tablepre}threads t ON ft.tid=t.tid WHERE ft.uid='$discuz_uid' $sqladd ORDER BY t.lastpost DESC LIMIT $start_limit, $tpp"); $attentionlist = array(); while($attention = $db->fetch_array($query)) { if(!$attention['t_tid']) { $db->query("DELETE FROM {$tablepre}favoritethreads WHERE tid='$attention[tid]' AND uid='$discuz_uid'", 'UNBUFFERED'); continue; } $attention['lastpost'] = dgmdate("$dateformat $timeformat", $attention['lastpost'] + $timeoffset * 3600); $attention['forumname'] = $_DCACHE['forums'][$attention['fid']]['name']; $attentionlist[] = $attention; } } } else { if($type == 'forum') { if($deleteids = implodeids($delete)) { $db->query("DELETE FROM {$tablepre}favoriteforums WHERE fid IN ($deleteids) AND uid='$discuz_uid'", 'UNBUFFERED'); showmessage('favoriteforums_update_succeed', dreferer()); } } else { if($deleteids = implodeids($delete)) { $db->query("DELETE FROM {$tablepre}favoritethreads WHERE tid IN ($deleteids) AND uid='$discuz_uid'", 'UNBUFFERED'); } showmessage('favoritethreads_update_succeed', dreferer()); } } } else { showmessage('undefined_action', NULL, 'HALTED'); } if(!$uid) { include template('my'); } else { include template('viewpro_data'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/my.php
PHP
asf20
32,888
<? /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: plugin.php 20440 2009-09-28 01:13:19Z monkey $ */ define('CURSCRIPT', 'plugin'); require_once './include/common.inc.php'; if(!empty($id)) { list($identifier, $module) = explode(':', $id); $module = $module !== NULL ? $module : $identifier; } $mnid = 'plugin_'.$identifier.'_'.$module; $pluginmodule = isset($pluginlinks[$identifier][$module]) ? $pluginlinks[$identifier][$module] : (isset($plugins['script'][$identifier][$module]) ? $plugins['script'][$identifier][$module] : array('adminid' => 0, 'directory' => preg_match("/^[a-z]+[a-z0-9_]*$/i", $identifier) ? $identifier.'/' : '')); if(empty($identifier) || !preg_match("/^[a-z0-9_\-]+$/i", $module) || !in_array($identifier, $plugins['available'])) { showmessage('undefined_action'); } elseif($pluginmodule['adminid'] && ($adminid < 1 || ($adminid > 0 && $pluginmodule['adminid'] < $adminid))) { showmessage('plugin_nopermission'); } elseif(@!file_exists(DISCUZ_ROOT.($modfile = './plugins/'.$pluginmodule['directory'].$module.'.inc.php'))) { showmessage('plugin_module_nonexistence'); } if(@in_array($identifier, $pluginlangs)) { @include_once DISCUZ_ROOT.'./forumdata/cache/cache_scriptlang.php'; } include DISCUZ_ROOT.$modfile; function plugintemplate($file) { global $identifier, $pluginmodule; return template($file, $identifier, './plugins/'.$pluginmodule['directory'].'templates'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/plugin.php
PHP
asf20
1,514
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: sitemap.php 16688 2008-11-14 06:41:07Z cnteacher $ */ error_reporting(0); define('IN_DISCUZ', TRUE); define('DISCUZ_ROOT', './'); if(PHP_VERSION < '4.1.0') { $_GET = &$HTTP_GET_VARS; $_SERVER = &$HTTP_SERVER_VARS; } require_once DISCUZ_ROOT.'./config.inc.php'; require_once DISCUZ_ROOT.'./include/global.func.php'; require_once DISCUZ_ROOT.'./include/db_'.$database.'.class.php'; require_once DISCUZ_ROOT.'./forumdata/cache/cache_settings.php'; require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php'; $maxitemnum = 500; $timestamp = time(); $PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $boardurl = 'http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1); $db = new dbstuff; $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset); unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect); if(!$_DCACHE['settings']['baidusitemap']) { exit('Baidu Sitemaps is closed!'); } $sitemapfile = DISCUZ_ROOT.'./forumdata/sitemap.xml'; $xmlfiletime = @filemtime($sitemapfile); header("Content-type: application/xml"); $xmlcontent = "<?xml version=\"1.0\" encoding=\"$charset\"?>\n". "<document xmlns:bbs=\"http://www.baidu.com/search/bbs_sitemap.xsd\">\n"; if($timestamp - $xmlfiletime >= $_DCACHE['settings']['baidusitemap_life'] * 3600) { $groupid = 7; $extgroupids = ''; $xmlfiletime = $timestamp - $_DCACHE['settings']['baidusitemap_life'] * 3600; $fidarray = array(); foreach($_DCACHE['forums'] as $fid => $forum) { if(sitemapforumperm($forum)) { $fidarray[] = $fid; } } $query = $db->query("SELECT tid, fid, subject, dateline, lastpost, replies, views, digest FROM {$tablepre}threads WHERE dateline > $xmlfiletime AND fid IN (".implode(',', $fidarray).") AND displayorder >= 0 LIMIT $maxitemnum"); $xmlcontent .= " <webSite>$boardurl</webSite>\n". " <webMaster>$adminemail</webMaster>\n". " <updatePeri>".$_DCACHE['settings']['baidusitemap_life']."</updatePeri>\n". " <updatetime>".gmdate('Y-m-d H:i:s', $timestamp + $_DCACHE['settings']['timeoffset'] * 3600)."</updatetime>\n". " <version>Discuz! {$_DCACHE['settings']['version']}</version>\n"; while($thread = $db->fetch_array($query)) { $xmlcontent .= " <item>\n". " <link>".(!$_DCACHE['settings']['rewritestatus'] ? "{$boardurl}viewthread.php?tid=$thread[tid]" : "{$boardurl}thread-$thread[tid]-1-1.html")."</link>\n". " <title>".dhtmlspecialchars($thread['subject'])."</title>\n". " <pubDate>".gmdate('Y-m-d H:i:s', $thread['dateline'] + $_DCACHE['settings']['timeoffset'] * 3600)."</pubDate>\n". " <bbs:lastDate>".gmdate('Y-m-d H:i:s', $thread['lastpost'] + $_DCACHE['settings']['timeoffset'] * 3600)."</bbs:lastDate>\n". " <bbs:reply>$thread[replies]</bbs:reply>\n". " <bbs:hit>$thread[views]</bbs:hit>\n". " <bbs:boardid>$thread[fid]</bbs:boardid>\n". " <bbs:pick>".(empty($thread['digest']) ? 0 : 1)."</bbs:pick>\n". " </item>\n"; } $xmlcontent .= "</document>"; if($fp = @fopen($sitemapfile, 'w')) { fwrite($fp, $xmlcontent); flock($fp, 2); fclose($fp); } echo $xmlcontent; } else { @readfile($sitemapfile); } function sitemapforumperm($forum) { return $forum['type'] != 'group' && (!$forum['viewperm'] || ($forum['viewperm'] && forumperm($forum['viewperm']))); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/sitemap.php
PHP
asf20
3,524
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: index.php 16722 2008-11-17 04:38:57Z cnteacher $ */ define('CURSCRIPT', 'wap'); require_once '../include/common.inc.php'; if(preg_match('/(mozilla|m3gate|winwap|openwave)/i', $_SERVER['HTTP_USER_AGENT'])) { dheader("Location: {$boardurl}index.php"); } require_once './include/global.func.php'; require_once DISCUZ_ROOT.'./include/forum.func.php'; require_once DISCUZ_ROOT.'./include/chinese.class.php'; @include_once(DISCUZ_ROOT.'./forumdata/cache/cache_forums.php'); $discuz_action = 191; $action = isset($action) ? $action : 'home'; if($action == 'goto' && !empty($url)) { header("Location: $url"); exit(); } else { wapheader($bbname); } include language('wap'); if(!$wapstatus) { wapmsg('wap_disabled'); } elseif($bbclosed) { wapmsg('board_closed'); } $sdb = loadmultiserver('wap'); $chs = ''; if(in_array($action, array('home', 'login', 'register', 'search', 'stats', 'my', 'myphone', 'goto', 'forum', 'thread', 'post'))) { require_once './include/'.$action.'.inc.php'; } else { wapmsg('undefined_action'); } wapfooter(); ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/index.php
PHP
asf20
1,208
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: thread.inc.php 21035 2009-11-09 02:07:45Z zhaoxiongfei $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $discuz_action = 193; $breaked = 0; $threadposts = ''; $start = isset($start) ? intval($start) : 0; $offset = isset($offset) ? intval($offset) : 0; $do = !empty($do) ? $do : ''; $thread = $sdb->fetch_first("SELECT * FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'"); if(!$thread) { wapmsg('thread_nonexistence'); } $hiddenreplies = getstatus($thread['status'], 2); if(($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) || (empty($forum['allowview']) && ((!$forum['viewperm'] && !$readaccess) || ($forum['viewperm'] && !forumperm($forum['viewperm'])))) || $forum['password'] || $forum['redirect']) { wapmsg('thread_nopermission'); } elseif($thread['price'] > 0) { if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) { $db->query("UPDATE {$tablepre}threads SET price='0' WHERE tid='$tid'"); $thread['price'] = 0; } elseif(!$discuz_uid || (!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid && !$db->num_rows($db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'")))) { wapmsg('thread_nopermission'); } } if(empty($do)) { echo "<p>$lang[subject]$thread[subject]<br />". "$lang[author]<a href=\"index.php?action=my&amp;uid=$thread[authorid]\">$thread[author]</a><br />". "$lang[dateline]".gmdate("$wapdateformat $timeformat", $thread['dateline'] + $timeoffset * 3600)."<br /><br />"; $page = max(1, intval($page)); $start_limit = $number = ($page - 1) * $wapppp; if($page < 2) { $end_limit = $wapppp + 1; } else { $start_limit = $start_limit + 1; $end_limit = $wapppp; } $query = $sdb->query("SELECT p.*, m.groupid FROM {$tablepre}posts p LEFT JOIN {$tablepre}members m ON p.authorid=m.uid WHERE p.tid='$tid' AND p.invisible='0' ORDER BY p.dateline LIMIT $start_limit, $end_limit"); while($post = $sdb->fetch_array($query)) { $needhiddenreply = ($hiddenreplies && $discuz_uid != $post['authorid'] && $discuz_uid != $thread['authorid'] && !$post['first'] && !$forum['ismoderator']); if($post['status'] & 1) { $post['message'] = $lang['thread_banned']; } if(in_array($post['groupid'], array(4, 5, 6))) { $post['message'] = $lang['thread_banned']; } if($needhiddenreply) { $post['needhiddenreply'] = $needhiddenreply; $post['message'] = $lang['message_ishidden_hiddenreplies']; } $post['message'] = wapcode($post['message']); if($post['first']) { if($offset > 0) { $str = $post['message']; for($i = $offset; $i > $offset - $wapmps + 2; $i --) { if(ord($str[$i-1]) > 127) { $i --; } } $offset_last = $i; $post['message'] = substr($post['message'], $offset); } else { $offset = 0; } if(strlen($post['message']) > $wapmps) { $post['message'] = wapcutstr($post['message'], $wapmps); $offset_next = $offset + $wapmps; $breaked = 1; } else { $breaked = 0; } if($adminid != 1 && $post['status'] & 1) { $post['message'] = $lang['message_single_banned']; } else { if($post['status'] & 1) { $post['message'] = '<p>' . $lang['admin_message_single_banned'] . '</p>' . $post['message']; } } $post['author'] = !$post['anonymous'] ? $post['author'] : $lang['anonymous']; $threadposts .= nl2br(trim($post['message'])); } else { $postlist[] = $post; } } echo $threadposts.(!$breaked ? '' : "<br /><a href=\"index.php?action=thread&amp;tid=$tid&amp;offset=$offset_next\">$lang[next_page]</a> "). (!$offset ? '' : "<a href=\"index.php?action=thread&amp;tid=$tid&amp;offset=$offset_last\">$lang[last_page]</a>")."<br />\n". "<br /><a href=\"index.php?action=post&amp;do=reply&amp;fid=$forum[fid]&amp;tid=$thread[tid]\">$lang[post_reply]</a>|<a href=\"index.php?action=post&amp;do=newthread&amp;fid=$forum[fid]\">$lang[post_new]</a>\n"; if(!empty($postlist)) { echo "<br /><br />$lang[thread_replylist] ($thread[replies])<br />"; foreach($postlist as $post) { $waptlength = 30; if(isset($post['needhiddenreply']) && $post['needhiddenreply']) { echo "#".++$number." ".wapcutstr(trim($post['message']), $waptlength); } else { echo "<a href=\"index.php?action=thread&amp;do=reply&amp;tid=$post[tid]&amp;pid=$post[pid]\">#".++$number." ".wapcutstr(trim($post['message']), $waptlength)."</a>"; } echo "<br />[".(!$post['anonymous'] ? $post['author'].' ' : $lang['anonymous'].' ').gmdate("$wapdateformat $timeformat", $post['dateline'] + $timeoffset * 3600)."]<br />"; } echo wapmulti($thread['replies'], $wapppp, $page, "index.php?action=thread&amp;tid=$thread[tid]"); } } elseif($do == 'reply') { $post = $db->fetch_first("SELECT * FROM {$tablepre}posts WHERE pid='$pid' AND invisible='0'"); if($post['status'] & 1) { $post['message'] = $lang['thread_banned']; } $needhiddenreply = ($hiddenreplies && $discuz_uid != $post['authorid'] && $discuz_uid != $thread['authorid'] && !$post['first'] && !$forum['ismoderator']); if($needhiddenreply) { wapmsg('message_ishidden_hiddenreplies'); } if($offset > 0) { $post['message'] = '..'.substr($post['message'], $offset - 4); } if(strlen($threadposts) + strlen($post['message']) - $wapmps > 0) { $length = $wapmps - strlen($threadposts); $post['message'] = wapcutstr($post['message'], $length); $offset += $length; $breaked = 1; } $post['author'] = !$post['anonymous'] ? $post['author'] : $lang['anonymous']; $post['message'] = wapcode($post['message']); echo "<p>$lang[thread_reply]<a href=\"index.php?action=thread&amp;tid=$thread[tid]\">$thread[subject]</a><br />"; echo $lang['author'].(!$post['anonymous'] ? "<a href=\"index.php?action=my&amp;uid=$post[authorid]\">$post[author]</a>" : $lang['anonymous'])."<br />\n". "<br />".nl2br(trim($post['message']))."\n"; if(!$breaked) { $start++; $offset = 0; } } echo "<br />". (!empty($allowreply) ? "<br /><input type=\"text\" name=\"message\" value=\"\" size=\"6\" emptyok=\"true\"/>\n". "<anchor title=\"$lang[submit]\">$lang[thread_quickreply]". "<go method=\"post\" href=\"index.php?action=post&amp;do=reply&amp;fid=$forum[fid]&amp;tid=$thread[tid]&amp;sid=$sid\">\n". "<postfield name=\"message\" value=\"$(message)\"/>\n". "<postfield name=\"formhash\" value=\"".formhash()."\" />\n". "</go></anchor><br />\n". "<a href=\"index.php?action=my&amp;do=fav&amp;favid=$thread[tid]&amp;type=thread\">$lang[my_addfav]</a><br />\n" : ''). "<br />&lt;&lt;<a href=\"index.php?action=goto&amp;do=next&amp;tid=$thread[tid]&amp;fid=$thread[fid]\">$lang[next_thread]</a>". "<br />&gt;&gt;<a href=\"index.php?action=goto&amp;do=last&amp;tid=$thread[tid]&amp;fid=$thread[fid]\">$lang[last_thread]</a><br />". "<a href=\"index.php?action=forum&amp;fid=$forum[fid]\">$lang[return_forum]</a></p>"; ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/thread.inc.php
PHP
asf20
7,204
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: post.inc.php 19146 2009-08-14 02:29:31Z tiger $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } require_once DISCUZ_ROOT.'./include/discuzcode.func.php'; require_once DISCUZ_ROOT.'./include/post.func.php'; require_once DISCUZ_ROOT.'./include/forum.func.php'; if(empty($forum) || $forum['type'] == 'group') { wapmsg('forum_nonexistence'); } if(empty($forum['allowview']) && ((!$forum['viewperm'] && !$readaccess) || ($forum['viewperm'] && !forumperm($forum['viewperm'])))) { wapmsg('forum_nopermission'); } if(empty($bbcodeoff) && !$allowhidecode && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) { wapmsg('post_hide_nopermission'); } formulaperm($forum['formulaperm']); if(!$adminid && $newbiespan && (!$lastpost || $timestamp - $lastpost < $newbiespan * 3600)) { $regdate = $db->result_first("SELECT regdate FROM {$tablepre}members WHERE uid='$discuz_uid'"); if($timestamp - $regdate < $newbiespan * 3600) { showmessage('post_newbie_span'); } } $postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post']; $replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply']; $modnewthreads = (!$allowdirectpost || $allowdirectpost == 1) && ($forum['modnewposts'] || !empty($censormod)) ? 1 : 0; $modnewreplies = (!$allowdirectpost || $allowdirectpost == 2) && ($forum['modnewposts'] == 2 || !empty($censormod)) ? 1 : 0; $subject = wapconvert($subject); $subject = ($subject != '') ? dhtmlspecialchars(censor(trim($subject))) : ''; $message = wapconvert($message); $message = ($message != '') ? censor(trim($message)) : ''; if($do == 'newthread') { $discuz_action = 195; if(!$discuz_uid && !((!$forum['postperm'] && $allowpost) || ($forum['postperm'] && forumperm($forum['postperm'])))) { wapmsg('post_newthread_nopermission'); } elseif(empty($forum['allowpost'])) { if(!$forum['postperm'] && !$allowpost) { wapmsg('post_newthread_nopermission'); } elseif($forum['postperm'] && !forumperm($forum['postperm'])) { wapmsg('post_newthread_nopermission'); } } elseif($forum['allowpost'] == -1) { wapmsg('post_newthread_nopermission'); } if(empty($subject) || empty($message)) { $typeselect = isset($forum['threadtypes']['required']) ? typeselect() : ''; echo "<p>".($typeselect ? "$lang[type]$typeselect<br />\n" : ''). "$lang[subject]<input type=\"text\" name=\"subject\" value=\"\" maxlength=\"80\" format=\"M*m\" /><br />\n". "$lang[message]<input type=\"text\" name=\"message\" value=\"\" format=\"M*m\" /><br />\n". "<anchor title=\"$lang[submit]\">$lang[submit]". "<go method=\"post\" href=\"index.php?action=post&amp;do=newthread&amp;fid=$fid&amp;sid=$sid\">\n". "<postfield name=\"subject\" value=\"$(subject)\" />\n". "<postfield name=\"message\" value=\"$(message)\" />\n". "<postfield name=\"formhash\" value=\"".formhash()."\" />\n". ($typeselect ? "<postfield name=\"typeid\" value=\"$(typeid)\" />\n" : ''). "</go></anchor>\n<br /><br />". "<a href=\"index.php?action=forum&amp;fid=$fid\">$lang[return_forum]</a></p>\n"; } else { if($post_invalid = checkpost()) { wapmsg($post_invalid); } if($formhash != formhash()) { wapmsg('wap_submit_invalid'); } if(checkflood()) { wapmsg('post_flood_ctrl'); } $typeid = isset($forum['threadtypes']['types'][$typeid]) ? $typeid : 0; if(empty($typeid) && !empty($forum['threadtypes']['required'])) { wapmsg('post_type_isnull'); } $displayorder = $pinvisible = $modnewthreads ? -2 : 0; $db->query("INSERT INTO {$tablepre}threads (fid, readperm, iconid, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, special, attachment, moderated) VALUES ('$fid', '0', '0', '$typeid', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$timestamp', '$discuz_user', '$displayorder', '0', '0', '0', '0')"); $tid = $db->insert_id(); $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment) VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '0', '0', '0', '0', '0', '0')"); $pid = $db->insert_id(); if($modnewthreads) { wapmsg('post_mod_succeed', array('title' => 'post_mod_forward', 'link' => "index.php?action=forum&amp;tid=$fid")); } else { updatepostcredits('+', $discuz_uid, $postcredits); $lastpost = "$tid\t$subject\t$timestamp\t$discuz_user"; $db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost', threads=threads+1, posts=posts+1, todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED'); if($forum['type'] == 'sub') { $db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost' WHERE fid='$forum[fup]'", 'UNBUFFERED'); } wapmsg('post_newthread_succeed', array('title' => 'post_newthread_forward', 'link' => "index.php?action=thread&amp;tid=$tid")); } } } elseif($do == 'reply') { $discuz_action = 196; $thread = $db->fetch_first("SELECT * FROM {$tablepre}threads WHERE tid='$tid'"); if(!$thread) { wapmsg('thread_nonexistence'); } if(empty($forum['allowreply']) && ((!$forum['replyperm'] && !$allowreply) || ($forum['replyperm'] && !forumperm($forum['replyperm'])))) { wapmsg('post_newreply_nopermission'); } if($thread['closed'] && !$forum['ismoderator']) { wapmsg('post_thread_closed'); } if($post_autoclose = checkautoclose()) { wapmsg($post_autoclose); } if(empty($message)) { echo "<p>$lang[message]<input type=\"text\" name=\"message\" value=\"\" format=\"M*m\" /><br />\n". "<anchor title=\"$lang[submit]\">$lang[submit]". "<go method=\"post\" href=\"index.php?action=post&amp;do=reply&amp;fid=$fid&amp;tid=$tid&amp;sid=$sid\">\n". "<postfield name=\"subject\" value=\"$(subject)\" />\n". "<postfield name=\"message\" value=\"$(message)\" />\n". "<postfield name=\"formhash\" value=\"".formhash()."\" />\n". "</go></anchor><br /><br />\n". "<a href=\"index.php?action=thread&amp;tid=$tid\">$lang[return_thread]</a><br />\n". "<a href=\"index.php?action=forum&amp;fid=$fid\">$lang[return_forum]</a></p>\n"; } else { if($message == '') { wapmsg('post_sm_isnull'); } if($post_invalid = checkpost()) { wapmsg($post_invalid); } if($formhash != formhash()) { wapmsg('wap_submit_invalid'); } if(checkflood()) { wapmsg('post_flood_ctrl'); } $pinvisible = $modnewreplies ? -2 : 0; $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, dateline, message, useip, invisible, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment) VALUES ('$fid', '$tid', '0', '$discuz_user', '$discuz_uid', '$timestamp', '$message', '$onlineip', '$pinvisible', '1', '0', '0', '0', '0', '0')"); $pid = $db->insert_id(); if($modnewreplies) { wapmsg('post_mod_succeed', array('title' => 'post_mod_forward', 'link' => "index.php?action=forum&amp;fid=$fid")); } else { $db->query("UPDATE {$tablepre}threads SET lastposter='$discuz_user', lastpost='$timestamp', replies=replies+1 WHERE tid='$tid' AND fid='$fid'", 'UNBUFFERED'); updatepostcredits('+', $discuz_uid, $replycredits); $lastpost = "$thread[tid]\t".addslashes($thread['subject'])."\t$timestamp\t$discuz_user"; $db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost', posts=posts+1, todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED'); if($forum['type'] == 'sub') { $db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost' WHERE fid='$forum[fup]'", 'UNBUFFERED'); } wapmsg('post_newreply_succeed', array('title' => 'post_newreply_forward', 'link' => "index.php?action=thread&amp;tid=$tid&amp;page=".(@ceil(($thread['replies'] + 2) / $wapppp)))); } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/post.inc.php
PHP
asf20
8,175
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: goto.inc.php 16721 2008-11-17 04:30:43Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $discuz_action = 194; $do = !empty($do) && in_array($do, array('last', 'next')) ? $do : ''; if($do == 'last') { if($fid && $tid) { $this_lastpost = $sdb->result_first("SELECT lastpost FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'"); if($next = $sdb->fetch_first("SELECT tid FROM {$tablepre}threads WHERE fid='$fid' AND displayorder>='0' AND lastpost>'$this_lastpost' ORDER BY lastpost ASC LIMIT 1")) { $tid = $next['tid']; header("Location: index.php?action=thread&tid=$tid"); exit(); } else { wapmsg('goto_last_nonexistence'); } } else { wapmsg('undefined_action'); } } elseif($do == 'next') { if($fid && $tid) { $this_lastpost = $sdb->result_first("SELECT lastpost FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'"); if($last = $sdb->fetch_first("SELECT tid FROM {$tablepre}threads WHERE fid='$fid' AND displayorder>='0' AND lastpost<'$this_lastpost' ORDER BY lastpost DESC LIMIT 1")) { $tid = $last['tid']; header("Location: index.php?action=thread&tid=$tid"); exit(); } else { wapmsg('goto_next_nonexistence'); } } else { wapmsg('undefined_action'); } } else { echo "<p>$lang[goto]:<br />\n". "<input title=\"url\" name=\"url\" type=\"text\" value=\"http://\" /><br />\n". "<anchor title=\"$lang[submit]\">$lang[submit]<go href=\"index.php?action=goto&amp;url=$(url:escape)\" /></anchor></p>\n"; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/goto.inc.php
PHP
asf20
1,683
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: myphone.inc.php 16688 2008-11-14 06:41:07Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $discuz_action = 194; echo "<p>$lang[my_phone]<br />".dhtmlspecialchars($_SERVER[HTTP_USER_AGENT])."<br /><br />"; if(function_exists('getallheaders')) { foreach(getallheaders() as $key => $value) { echo strtoupper($key).": $value<br/>\n"; } } else { foreach(array('REMOTE_ADDR', 'REMOTE_PORT', 'REMOTE_USER', 'GATEWAY_INTERFACE', 'SERVER_PROTOCOL', 'HTTP_CONNECTION', 'HTTP_VIA') as $key) { if(!empty($_SERVER[$key])) { echo "<br />$key: ".dhtmlspecialchars($_SERVER[$key])."\n"; } } } echo '</p>'; ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/myphone.inc.php
PHP
asf20
778
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: stats.inc.php 18819 2009-07-23 10:38:43Z liuqiang $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $discuz_action = 194; $members = $totalmembers; @extract($sdb->fetch_first("SELECT SUM(threads) AS threads, SUM(posts) AS posts FROM {$tablepre}forums WHERE status='1'")); echo "<p>$lang[stats]<br /><br />\n". "$lang[stats_members]: $members<br />\n". "$lang[stats_threads]: $threads<br />\n". "$lang[stats_posts]: $posts</p>\n"; ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/stats.inc.php
PHP
asf20
590
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: home.inc.php 19072 2009-08-12 05:01:33Z wangjinbo $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000; $onlinemem = $onlineguest = $forumnum = 0; echo "<p>$bbname<br />\n"; if($discuz_uid) { echo (!empty($allowsearch) ? "<br /><a href=\"index.php?action=search&amp;srchfrom=$newthreads&amp;do=submit\">$lang[home_newthreads]</a><br /><a href=\"index.php?action=search\">$lang[search]</a><br />" : ''). "<a href=\"index.php?action=my&amp;do=fav\">$lang[my_favorites]</a><br />". "<a href=\"index.php?action=my\">$lang[my]</a><br />"; } echo "<br />$lang[home_forums]<br />"; $sql = !empty($accessmasks) ? "SELECT f.fid, f.name, f.fup, f.type, ff.viewperm, a.allowview FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid WHERE f.status='1' AND f.type='forum' ORDER BY f.displayorder" : "SELECT f.fid, f.name, f.fup, f.type, ff.viewperm FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff USING(fid) WHERE f.status='1' AND f.type='forum' ORDER BY f.type, f.displayorder"; $query = $sdb->query($sql); $forumlist = array(); while($forum = $sdb->fetch_array($query)) { $forumlist[] = $forum; } foreach($forumlist as $forum) { if(forum($forum) && (!$forum['viewperm'] || (strexists("\t".trim($forum['viewperm'])."\t", "\t".trim($groupid)."\t") && $forum['viewperm']))) { echo "<a href=\"index.php?action=forum&amp;fid=$forum[fid]\">".strip_tags($forum['name'])."</a><br/>"; } if($forumnum ++ >= 10) { break; } } echo ($forumnum > 10 ? "<a href=\"index.php?action=forum\">$lang[more]</a><br /><br />" : ''). "$lang[home_tools]<br />". "<a href=\"index.php?action=stats\">$lang[stats]</a><br />". "<a href=\"index.php?action=goto\">$lang[goto]</a>". (!empty($allowsearch) ? "<br /><br /><input type=\"text\" name=\"srchtxt\" value=\"\" size=\"8\" emptyok=\"true\" /> ". "<anchor title=\"submit\">$lang[search]\n". "<go method=\"post\" href=\"index.php?action=search&amp;do=submit\" />\n". "<postfield name=\"srchtxt\" value=\"$(srchtxt)\" /></anchor>" : ''); $query = $db->query("SELECT uid, COUNT(*) AS count FROM {$tablepre}sessions GROUP BY uid='0'"); while($online = $db->fetch_array($query)) { $online['uid'] ? $onlinemem = $online['count'] : $onlineguest = $online['count']; } echo "<br /><br />$lang[home_online]".($onlinemem + $onlineguest)."({$onlinemem} $lang[home_members])</p>\n"; ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/home.inc.php
PHP
asf20
2,708
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: forum.inc.php 19046 2009-08-10 10:04:18Z wangjinbo $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $discuz_action = 192; $page = max(1, intval($page)); $start_limit = $number = ($page - 1) * $waptpp; if(!empty($fid)) { require_once DISCUZ_ROOT.'./include/forum.func.php'; if(empty($forum)) { wapmsg('forum_nonexistence'); } if(($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) || $forum['redirect'] || $forum['password']) { wapmsg('forum_nopermission'); } elseif($forum['formulaperm']) { formulaperm($forum['formulaperm'], 0, TRUE); } echo "<p>".strip_tags($forum['name'])."<br />". "<a href=\"index.php?action=post&amp;do=newthread&amp;fid=$forum[fid]\">$lang[post_new]</a> ". "<a href=\"index.php?action=forum&amp;do=digest&amp;fid=$forum[fid]\">$lang[digest]</a><br /><br />". "$lang[forum_list] <a href=\"index.php?action=forum&amp;fid=$forum[fid]\">$lang[reload]</a><br />"; $do = !empty($do) ? 'digest' : ''; $filteradd = $do == 'digest' ? 'AND digest>\'0\'' : ''; $threadcount = $sdb->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE fid='$fid' $filteradd AND displayorder>='0'"); $thread['prefix'] = ''; $query = $sdb->query("SELECT * FROM {$tablepre}threads WHERE fid='$fid' $filteradd AND displayorder>='0' ORDER BY displayorder DESC, lastpost DESC LIMIT $start_limit, $waptpp"); while($thread = $sdb->fetch_array($query)) { $thread['prefix'] .= $thread['displayorder'] > 0 ? $lang['forum_thread_sticky'] : ''; $thread['prefix'] .= $thread['digest'] ? $lang['forum_thread_digest'] : ''; echo "<a href=\"index.php?action=thread&amp;tid=$thread[tid]\">#".++$number." ".cutstr($thread['subject'], 30)."</a>$thread[prefix]<br />\n". "<small>[$thread[author] $lang[replies]$thread[replies] $lang[views]$thread[views]]</small><br />\n"; } echo wapmulti($threadcount, $waptpp, $page, "index.php?action=forum&amp;fid=$forum[fid]&amp;sid=$sid"); if($do != 'digest') { $subforums = ''; foreach($_DCACHE['forums'] as $subforum) { if($subforum['type'] == 'sub' && $subforum['fup'] == $fid && (!$forum['viewperm'] || (strexists("\t".trim($forum['viewperm'])."\t", "\t".trim($groupid)."\t")))) { $subforums .= "<a href=\"index.php?action=forum&amp;fid=$subforum[fid]\">".strip_tags($subforum['name'])."</a><br />"; } } if(!empty($subforums)) { echo "<br /><br />$lang[forum_sublist]<br />".$subforums; } } echo (!empty($allowsearch) ? "<br /><br /><a href=\"index.php?action=post&amp;do=newthread&amp;fid=$forum[fid]\">$lang[post_new]</a><br />". "<a href=\"index.php?action=my&amp;do=fav&amp;favid=$forum[fid]&amp;type=forum\">$lang[my_addfav]</a><br />". "<input type=\"text\" name=\"srchtxt\" value=\"\" size=\"6\" format=\"M*m\" emptyok=\"true\"/>". "<anchor title=\"submit\">$lang[search]\n". "<go method=\"post\" href=\"index.php?action=search&amp;srchfid=$forum[fid]&amp;do=submit&amp;sid=$sid\">\n". "<postfield name=\"srchtxt\" value=\"$(srchtxt)\" />\n". "</go></anchor><br />" : ''). "</p>"; } else { echo "<p>$lang[home_forums]<br />"; $forumcount = $db->result_first("SELECT COUNT(*) FROM {$tablepre}forums WHERE status='1' AND type='forum'"); $sql = !empty($accessmasks) ? "SELECT f.fid, f.name, ff.viewperm, a.allowview FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid WHERE f.status='1' AND f.type='forum' ORDER BY f.displayorder LIMIT $start_limit, $waptpp" : "SELECT f.fid, f.name, ff.viewperm FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff USING(fid) WHERE f.status='1' AND f.type='forum' ORDER BY f.displayorder LIMIT $start_limit, $waptpp"; $query = $sdb->query($sql); while($forum = $sdb->fetch_array($query)) { if(forum($forum) && (!$forum['viewperm'] || (strexists("\t".trim($forum['viewperm'])."\t", "\t".trim($groupid)."\t") && $forum['viewperm']))) { echo "<a href=\"index.php?action=forum&amp;fid=$forum[fid]\">".strip_tags($forum['name'])."</a><br/>"; } } echo wapmulti($forumcount, $waptpp, $page, "index.php?action=forum&amp;sid=$sid"); echo "</p>"; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/forum.inc.php
PHP
asf20
4,406
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: global.func.php 18537 2009-06-11 01:36:49Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } function wapheader($title) { global $action, $_SERVER; header("Content-type: text/vnd.wap.wml; charset=utf-8"); /* header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); */ echo "<?xml version=\"1.0\"?>\n". "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n". "<wml>\n". "<head>\n". "<meta http-equiv=\"cache-control\" content=\"max-age=180,private\" />\n". "</head>\n". "<card id=\"discuz_wml\" title=\"$title\">\n"; // newcontext=\"true\" } function wapfooter() { global $discuz_uid, $discuz_user, $lang, $action, $settings, $timestamp, $timeoffset, $wapdateformat, $timeformat; echo "<p>".gmdate("$wapdateformat $timeformat", $timestamp + ($timeoffset * 3600))."<br />". ($action != 'home' ? "<anchor title=\"confirm\"><prev/>$lang[return]</anchor> <a href=\"index.php\">$lang[home_page]</a><br />" : ''). ($discuz_uid ? "<a href=\"index.php?action=login&amp;logout=yes&amp;formhash=".FORMHASH."\">$discuz_user:$lang[logout]</a>" : "<a href=\"index.php?action=login\">$lang[login]</a> <a href=\"index.php?action=register\">$lang[register]</a>")."<br /><br />\n". "<small>Powered by Discuz!</small></p>\n". //"<do type=\"prev\" label=\"$lang[return]\"><exit /></do>\n". "</card>\n". "</wml>"; updatesession(); wmloutput(); } function wapmsg($message, $forward = array()) { extract($GLOBALS, EXTR_SKIP); if(isset($lang[$message])) { eval("\$message = \"".$lang[$message]."\";"); } echo "<p>$message". ($forward ? "<br /><a href=\"$forward[link]\">".(isset($lang[$forward['title']]) ? $lang[$forward['title']] : $forward['title'])."</a>" : ''). "</p>\n"; wapfooter(); exit(); } function wapmulti($num, $perpage, $curpage, $mpurl) { global $lang; $multipage = ''; $mpurl .= strpos($mpurl, '?') ? '&amp;' : '?'; if($num > $perpage) { $page = 3; $offset = 2; $realpages = @ceil($num / $perpage); $pages = $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; } } $multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href="'.$mpurl.'page=1">'.$lang['home_page'].'</a>' : ''). ($curpage > 1 ? ' <a href="'.$mpurl.'page='.($curpage - 1).'">'.$lang['last_page'].'</a>' : ''); for($i = $from; $i <= $to; $i++) { $multipage .= $i == $curpage ? ' '.$i : ' <a href="'.$mpurl.'page='.$i.'">'.$i.'</a>'; } $multipage .= ($curpage < $pages ? ' <a href="'.$mpurl.'page='.($curpage + 1).'">'.$lang['next_page'].'</a>' : ''). ($to < $pages ? ' <a href="'.$mpurl.'page='.$pages.'">'.$lang['end_page'].'</a>' : ''); $multipage .= $realpages > $page ? '<br />'.$curpage.'/'.$realpages.$lang['page'].'<input type="text" name="page" size="2" emptyok="true" /> '. '<anchor title="submit">'.$lang['turn_page'].'<go method="post" href="'.$mpurl.'">'. '<postfield name="page" value="$(page)" />'. '</go></anchor>' : ''; } return $multipage; } function wapcutstr($string, $length, $dot = ' ..') { global $charset; if(strlen($string) <= $length) { return $string; } $string = str_replace(array('&amp;', '&quot;', '&lt;', '&gt;'), array('&', '"', '<', '>'), $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 { for($i = 0; $i < $length; $i++) { $strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i]; } } $strcut = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $strcut); return $strcut.$dot; } function wapcode($string) { global $lang; $string = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string); $string = preg_replace("/\[hide\](.+?)\[\/hide\]/is", $lang['post_hide_reply_hidden'], $string); $string = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", $lang['post_hide_reply_hidden'], $string); for($i = 0; $i < 5; $i++) { $string = preg_replace("/\[(\w+)[^\]]*?\](.*?)\[\/\\1\]/is", "\\2", $string); } return $string; } function wmloutput() { global $sid, $charset, $wapcharset; static $chs; $content = preg_replace("/\<a(\s*[^\>]+\s*)href\=([\"|\']?)([^\"\'\s]+)/ies", "transsid('\\3','<a\\1href=\\2',1)", ob_get_contents()); ob_end_clean(); if($charset != 'utf-8') { $target = $wapcharset == 1 ? 'UTF-8' : 'UNICODE'; if(empty($chs)) { $chs = new Chinese($charset, $target); } else { $chs->config['SourceLang'] = $chs->_lang($charset); $chs->config['TargetLang'] = $target; } echo ($wapcharset == 1 ? $chs->Convert($content) : str_replace(array('&#x;', '&#x0;'), array('??', ''), $chs->Convert($content))); } else { echo $content; } } function wapconvert($str) { static $chs; if($str != '' && !is_numeric($str) && $GLOBALS['charset'] != 'utf-8') { $chs = empty($chs) ? new Chinese('UTF-8', $GLOBALS['charset']) : $chs; if(is_array($str)) { foreach($str as $key => $val) { $str[$key] = wapconvert($val); } } else { $str = addslashes($chs->Convert(stripslashes($str))); } } return $str; } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/global.func.php
PHP
asf20
6,495
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: search.inc.php 16718 2008-11-17 03:48:41Z cnteacher $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } $cachelife_time = 300; // Life span for cache of searching in specified range of time $cachelife_text = 3600; // Life span for cache of text searching if(!$allowsearch) { wapmsg('search_group_nopermission'); } $do = !empty($do) ? $do : ''; if($do != 'submit') { echo "<p>$lang[search]<br />". "$lang[keywords]:<input type=\"text\" name=\"srchtxt\" value=\"\" maxlength=\"15\" format=\"M*m\" /><br />\n". "$lang[username]:<input type=\"text\" name=\"srchuname\" value=\"\" format=\"M*m\" /><br />\n". "<anchor title=\"$lang[submit]\">$lang[submit]". "<go method=\"post\" href=\"index.php?action=search&amp;do=submit\">\n". "<postfield name=\"sid\" value=\"$sid\" />\n". "<postfield name=\"srchtxt\" value=\"$(srchtxt)\" />\n". "<postfield name=\"srchuname\" value=\"$(srchuname)\" />\n". "</go></anchor></p>"; } else { if(isset($searchid)) { $page = max(1, intval($page)); $start_limit = $number = ($page - 1) * $waptpp; $index = $db->fetch_first("SELECT searchstring, keywords, threads, tids FROM {$tablepre}searchindex WHERE searchid='$searchid'"); if(!$index) { wapmsg('search_id_invalid'); } $index['keywords'] = rawurlencode($index['keywords']); $index['searchtype'] = preg_replace("/^([a-z]+)\|.*/", "\\1", $index['searchstring']); $searchnum = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE tid IN ($index[tids]) AND displayorder>='0'"); if($searchnum) { echo "<p>$lang[search_result]<br />"; $query = $db->query("SELECT * FROM {$tablepre}threads WHERE tid IN ($index[tids]) AND displayorder>='0' ORDER BY dateline DESC LIMIT $start_limit, $waptpp"); while($thread = $db->fetch_array($query)) { echo "<a href=\"index.php?action=thread&amp;tid=$thread[tid]\">#".++$number." ".cutstr($thread['subject'], 24)."</a>($thread[views]/$thread[replies])<br />\n"; } echo wapmulti($searchnum, $waptpp, $page, "index.php?action=search&amp;searchid=$searchid&amp;do=submit&amp;sid=$sid"); echo '</p>'; } else { wapmsg('search_invalid'); } } else { $srchtxt = trim(wapconvert($srchtxt)); $srchuname = trim(wapconvert($srchuname)); $srchuid = intval($srchuid); $searchstring = 'title|'.addslashes($srchtxt).'|'.$srchuid.'|'.$srchuname; $searchindex = array('id' => 0, 'dateline' => '0'); $query = $db->query("SELECT searchid, dateline, ('$searchctrl'<>'0' AND ".(empty($discuz_uid) ? "useip='$onlineip'" : "uid='$discuz_uid'")." AND $timestamp-dateline<$searchctrl) AS flood, (searchstring='$searchstring' AND expiration>'$timestamp') AS indexvalid FROM {$tablepre}searchindex WHERE ('$searchctrl'<>'0' AND ".(empty($discuz_uid) ? "useip='$onlineip'" : "uid='$discuz_uid'")." AND $timestamp-dateline<$searchctrl) OR (searchstring='$searchstring' AND expiration>'$timestamp') ORDER BY flood"); while($index = $db->fetch_array($query)) { if($index['indexvalid'] && $index['dateline'] > $searchindex['dateline']) { $searchindex = array('id' => $index['searchid'], 'dateline' => $index['dateline']); break; } elseif($index['flood']) { wapmsg('search_ctrl'); } } if($searchindex['id']) { $searchid = $searchindex['id']; } else { if(empty($srchfid)) { $srchfid = 'all'; } if(!$srchtxt && !empty($srchuid) && !$srchuname && !$srchfrom) { wapmsg('search_invalid'); } if(!empty($srchfrom) && empty($srchtxt) && empty($srchuid) && empty($srchuname)) { $searchfrom = !empty($before) ? '<=' : '>='; $searchfrom .= $timestamp - $srchfrom; $sqlsrch = "FROM {$tablepre}threads t WHERE t.displayorder>='0' AND t.lastpost$searchfrom"; $expiration = $timestamp + $cachelife_time; $keywords = ''; } else { if(!empty($mytopics) && $srchuid) { $srchfrom = 2592000; $srchuname = $srchtxt = $before = ''; } $sqlsrch = "FROM {$tablepre}threads t WHERE t.displayorder>='0'"; if($srchuname) { $srchuid = $comma = ''; $srchuname = str_replace('*', '%', addcslashes($srchuname, '%_')); $query = $db->query("SELECT uid FROM {$tablepre}members WHERE username LIKE '".str_replace('_', '\_', $srchuname)."' LIMIT 50"); while($member = $db->fetch_array($query)) { $srchuid .= "$comma'$member[uid]'"; $comma = ', '; } if(!$srchuid) { $sqlsrch .= ' AND 0'; } } elseif($srchuid) { $srchuid = "'$srchuid'"; } $sqltxtsrch = ''; if($srchtxt) { $srchtxt = str_replace('*', '%', addcslashes($srchtxt, '%_')); $sqltxtsrch .= "t.subject LIKE '%$srchtxt%'"; $sqlsrch .= " AND ($sqltxtsrch)"; } if($srchuid) { $sqlsrch .= " AND authorid IN ($srchuid)"; } if($srchfid != 'all' && $srchfid) { $sqlsrch .= " AND fid='$srchfid'"; } $keywords = str_replace('%', '+', $srchtxt).(trim($srchuname) ? '+'.str_replace('%', '+', $srchuname) : ''); $expiration = $timestamp + $cachelife_text; } $threads = $tids = 0; $query = $sdb->query("SELECT DISTINCT t.tid, t.closed $sqlsrch ORDER BY tid DESC LIMIT $maxsearchresults"); while($thread = $sdb->fetch_array($query)) { if($thread['closed'] <= 1) { $tids .= ','.$thread['tid']; $threads++; } } $db->free_result($query); $db->query("INSERT INTO {$tablepre}searchindex (keywords, searchstring, useip, uid, dateline, expiration, threads, tids) VALUES ('$keywords', '$searchstring', '$onlineip', '$discuz_uid', '$timestamp', '$expiration', '$threads', '$tids')"); $searchid = $db->insert_id(); } header("Location: index.php?action=search&searchid=$searchid&do=submit&sid=$sid"); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/search.inc.php
PHP
asf20
6,010
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: register.inc.php 21057 2009-11-10 01:05:36Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if($discuz_uid) { wapmsg('login_succeed'); } if(!$wapregister) { wapmsg('register_disable'); } $groupinfo = $db->fetch_first("SELECT groupid FROM {$tablepre}usergroups WHERE ".($regverify ? "groupid='8'" : "creditshigher<=".intval($initcredits)." AND ".intval($initcredits)."<creditslower LIMIT 1")); if(empty($username)) { echo "<p>$lang[register_username]:<input type=\"text\" name=\"username\" value=\"\" maxlength=\"15\" /><br />\n". "$lang[password]: <input type=\"password\" name=\"password\" value=\"\" /><br />\n". "$lang[email]: <input type=\"text\" name=\"email\" value=\"\" /><br />\n". ($regverify == 2 ? "$lang[register_reason]: <input type=\"text\" name=\"regmessage\" value=\"\" />\n" : ''). "<anchor title=\"$lang[submit]\">$lang[submit]". "<go method=\"post\" href=\"index.php?action=register&amp;sid=$sid\">\n". "<postfield name=\"username\" value=\"$(username)\" />\n". "<postfield name=\"password\" value=\"$(password)\" />\n". "<postfield name=\"email\" value=\"$(email)\" />\n". "</go></anchor></p>\n"; } else { @include_once DISCUZ_ROOT.'./forumdata/cache/cache_register.php'; require_once DISCUZ_ROOT.'./uc_client/client.php'; $email = trim(wapconvert($email)); $username = trim(wapconvert($username)); $regmessage = dhtmlspecialchars(wapconvert($regmessage)); if(uc_get_user($username) && !$db->result_first("SELECT uid FROM {$tablepre}members WHERE username='$username'")) { wapmsg('register_activation_message'); } if($regstatus == 2) { wapmsg('register_invite'); } if($_DCACHE['ipctrl']['ipregctrl']) { foreach(explode("\n", $_DCACHE['ipctrl']['ipregctrl']) as $ctrlip) { if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $onlineip)) { $ctrlip = $ctrlip.'%'; $regctrl = 72; break; } } } else { $ctrlip = $onlineip; } if($_DCACHE['ipctrl']['ipverifywhite']) { foreach(explode("\n", $_DCACHE['ipctrl']['ipverifywhite']) as $ctrlip) { if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $onlineip)) { $regverify = 0; break; } } } if($regctrl) { $query = $db->query("SELECT ip FROM {$tablepre}regips WHERE ip LIKE '$ctrlip' AND count='-1' AND dateline>$timestamp-'$regctrl'*3600 LIMIT 1"); if($db->num_rows($query)) { wapmsg('register_ctrl', NULL, 'HALTED'); } } if($regfloodctrl) { if($regattempts = $db->result_first("SELECT count FROM {$tablepre}regips WHERE ip='$onlineip' AND count>'0' AND dateline>'$timestamp'-86400")) { if($regattempts >= $regfloodctrl) { wapmsg('register_flood_ctrl'); } else { $db->query("UPDATE {$tablepre}regips SET count=count+1 WHERE ip='$onlineip' AND count>'0'"); } } else { $db->query("INSERT INTO {$tablepre}regips (ip, count, dateline) VALUES ('$onlineip', '1', '$timestamp')"); } } $uid = uc_user_register($username, $password, $email); if($uid <= 0) { if($uid == -1) { wapmsg('profile_username_illegal'); } elseif($uid == -2) { wapmsg('profile_username_protect'); } elseif($uid == -3) { wapmsg('profile_username_duplicate'); } elseif($uid == -4) { wapmsg('profile_email_illegal'); } elseif($uid == -5) { wapmsg('profile_email_domain_illegal'); } elseif($uid == -6) { wapmsg('profile_email_duplicate'); } else { wapmsg('undefined_action'); } } $password = md5(random(10)); $idstring = random(6); $authstr = $regverify == 1 ? "$timestamp\t2\t$idstring" : ''; $db->query("REPLACE INTO {$tablepre}members (uid, username, password, secques, gender, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, extcredits1, extcredits2, extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, email, bday, sigstatus, tpp, ppp) VALUES ('$uid', '$username', '$password', '', '', '0', '$groupinfo[groupid]', '$onlineip', '$timestamp', '$timestamp', '$timestamp', '0', $initcredits, '$email', '', '', '20', '20')"); $db->query("REPLACE INTO {$tablepre}memberfields (uid, authstr) VALUES ('$uid', '$authstr')"); if($regverify == 2) { $db->query("REPLACE INTO {$tablepre}validating (uid, submitdate, moddate, admin, submittimes, status, message, remark) VALUES ('$uid', '$timestamp', '0', '', '1', '0', '$regmessage', '')"); } $discuz_uid = $uid; $discuz_user = $username; $discuz_userss = stripslashes($discuz_user); $discuz_pw = $password; $groupid = $groupinfo['groupid']; $styleid = $styleid ? $styleid : $_DCACHE['settings']['styleid']; switch($regverify) { case 1: sendmail("$discuz_userss <$email>", 'email_verify_subject', 'email_verify_message'); wapmsg('profile_email_verify'); break; case 2: wapmsg('register_manual_verify'); break; default: wapmsg('register_succeed'); break; } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/register.inc.php
PHP
asf20
5,134
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: login.inc.php 20798 2009-10-22 04:59:28Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } require_once DISCUZ_ROOT.'./include/misc.func.php'; if(empty($logout)) { if(empty($username)) { echo "<p>$lang[login_username]: <select name=\"loginfield\"> <option value=\"0\">$lang[username]</option> <option value=\"1\">$lang[uid]</option> </select> <input type=\"text\" name=\"username\" maxlength=\"15\" format=\"M*m\" /><br />\n". "$lang[password]: <input type=\"password\" name=\"password\" value=\"\" format=\"M*m\" /><br />\n". "$lang[security_question]: <select name=\"questionid\"> <option value=\"0\">$lang[security_question_0]</option> <option value=\"1\">$lang[security_question_1]</option> <option value=\"2\">$lang[security_question_2]</option> <option value=\"3\">$lang[security_question_3]</option> <option value=\"4\">$lang[security_question_4]</option> <option value=\"5\">$lang[security_question_5]</option> <option value=\"6\">$lang[security_question_6]</option> <option value=\"7\">$lang[security_question_7]</option> </select><br />\n". "$lang[security_answer]: <input type=\"answer\" name=\"answer\" value=\" \" format=\"M*m\" /><br />\n". "<anchor title=\"$lang[submit]\">$lang[submit]". "<go method=\"post\" href=\"index.php?action=login&amp;sid=$sid\">\n". "<postfield name=\"questionid\" value=\"$(questionid)\" />\n". "<postfield name=\"answer\" value=\"$(answer)\" />\n". "<postfield name=\"username\" value=\"$(username)\" />\n". "<postfield name=\"password\" value=\"$(password)\" />\n". "<postfield name=\"loginfield\" value=\"$(loginfield)\" />\n". "</go></anchor></p>\n"; } else { $loginperm = logincheck(); if(!$loginperm) { wapmsg('login_strike'); } $answer = wapconvert($answer); $username = wapconvert($username); require_once DISCUZ_ROOT.'./uc_client/client.php'; $ucresult = uc_user_login($username, $password, $loginfield, 1, $questionid, $answer); list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = daddslashes($ucresult, 1); $ucresult = $tmp; if($ucresult['uid'] > 0) { $member = $db->fetch_first("SELECT uid AS discuz_uid, username AS discuz_user, password AS discuz_pw, secques AS discuz_secques, groupid, invisible FROM {$tablepre}members WHERE uid='$ucresult[uid]'"); if(!$member) { if(!$wapregister) { wapmsg('activation_disable'); } $groupinfo = $db->fetch_first("SELECT groupid FROM {$tablepre}usergroups WHERE ".($regverify ? "groupid='8'" : "creditshigher<=".intval($initcredits)." AND ".intval($initcredits)."<creditslower LIMIT 1")); $idstring = random(6); $password = md5(random(10)); $authstr = $regverify == 1 ? "$timestamp\t2\t$idstring" : ''; $regmessage = dhtmlspecialchars($regmessage); $ucresult['username'] = addslashes($ucresult['username']); $db->query("REPLACE INTO {$tablepre}members (uid, username, password, secques, gender, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, extcredits1, extcredits2, extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, email, bday, sigstatus, tpp, ppp) VALUES ('$ucresult[uid]', '$ucresult[username]', '$password', '', '', '0', '$groupinfo[groupid]', '$onlineip', '$timestamp', '$timestamp', '$timestamp', '0', $initcredits, '$ucresult[email]', '', '', '20', '20')"); $db->query("REPLACE INTO {$tablepre}memberfields (uid, authstr) VALUES ('$ucresult[uid]', '$authstr')"); if($regverify == 2) { $db->query("REPLACE INTO {$tablepre}validating (uid, submitdate, moddate, admin, submittimes, status, message, remark) VALUES ('$ucresult[uid]', '$timestamp', '0', '', '1', '0', '$regmessage', '')"); } $member = $db->fetch_first("SELECT uid AS discuz_uid, username AS discuz_user, password AS discuz_pw, secques AS discuz_secques, groupid, invisible FROM {$tablepre}members WHERE uid='$ucresult[uid]'"); @extract($member); $discuz_user = addslashes($discuz_user); dsetcookie('auth', authcode("$discuz_pw\t$discuz_secques\t$discuz_uid", 'ENCODE'), 2592000, 1, true); wapmsg('login_succeed'); } @extract($member); $discuz_user = addslashes($discuz_user); dsetcookie('auth', authcode("$discuz_pw\t$discuz_secques\t$discuz_uid", 'ENCODE'), 2592000, 1, true); wapmsg('login_succeed'); } else { $errorlog = dhtmlspecialchars( $timestamp."\t". ($member['discuz_user'] ? $member['discuz_user'] : stripslashes($username))."\t". $password."\t". ($secques ? "Ques #".intval($questionid) : '')."\t". $onlineip); writelog('illegallog', $errorlog); wapmsg('login_invalid'); } } } elseif(!empty($formhash) && $formhash == FORMHASH) { $discuz_uid = 0; $discuz_user = ''; $groupid = 7; wapmsg('logout_succeed'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/login.inc.php
PHP
asf20
5,104
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: my.inc.php 19081 2009-08-12 09:26:57Z monkey $ */ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } if(empty($discuz_uid)) { wapmsg('not_loggedin'); } $uid = !empty($uid) ? intval($uid) : $discuz_uid; $username = !empty($username) ? dhtmlspecialchars($username) : ''; $usernameadd = $uid ? "m.uid='$uid'" : "m.username='$username'"; if(empty($do)) { $member = $sdb->fetch_first("SELECT m.*, mf.* FROM {$tablepre}members m LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid WHERE $usernameadd LIMIT 1"); if(!$member) { wapmsg('my_nonexistence'); } if($member['gender'] == '1') { $member['gender'] = $lang['my_male']; } elseif($member['gender'] == '2') { $member['gender'] = $lang['my_female']; } else { $member['gender'] = $lang['my_secrecy']; } echo "<p>$lang[my]<br /><br />". "$lang[my_uid] $member[uid]<br />". "$lang[my_username] $member[username]<br />". "$lang[my_gender] $member[gender]<br />". ($member['bday'] != '0000-00-00' ? "$lang[my_bday] $member[bday]<br />" : ''). ($member['location'] ? "$lang[my_location] $member[location]<br />" : ''). ($member['bio'] ? "$lang[my_bio] $member[bio]<br /><br />" : ''); if($uid == $discuz_uid) { echo "<a href=\"index.php?action=myphone\">$lang[my_phone]</a><br />". "<a href=\"index.php?action=my&amp;do=fav\">$lang[my_favorites]</a><br />"; } echo '</p>'; } else { if($do == 'fav') { if(!empty($favid)) { $selectid = $type == 'thread' ? 'tid' : 'fid'; if($db->result_first("SELECT $selectid FROM {$tablepre}favorites WHERE uid='$discuz_uid' AND $selectid='$favid' LIMIT 1")) { wapmsg('fav_existence'); } else { $db->query("INSERT INTO {$tablepre}favorites (uid, $selectid) VALUES ('$discuz_uid', '$favid')"); wapmsg('fav_add_succeed'); } } else { echo "<p>$lang[my_threads]<br />"; $query = $sdb->query("SELECT t.subject FROM {$tablepre}threads t WHERE t.authorid = '$discuz_uid' ORDER BY t.dateline DESC LIMIT 0, 3"); while($mythread = $sdb->fetch_array($query)) { echo "<a href=\"index.php?action=thread&amp;tid=$mythread[tid]\">".cutstr($mythread['subject'], 15)."</a><br />"; } echo "<br />$lang[my_replies]<br />"; $query = $sdb->query("SELECT DISTINCT t.tid, t.subject FROM {$tablepre}posts p INNER JOIN {$tablepre}threads t ON t.tid=p.tid WHERE p.authorid = '$discuz_uid' ORDER BY p.dateline DESC LIMIT 0, 3"); while($mypost = $sdb->fetch_array($query)) { echo "<a href=\"index.php?action=thread&amp;tid=$mypost[tid]\">".cutstr($mypost['subject'], 15)."</a><br />"; } echo "<br />$lang[my_fav_thread]<br />"; $query = $sdb->query("SELECT t.tid, t.subject FROM {$tablepre}favorites fav, {$tablepre}threads t WHERE fav.tid=t.tid AND t.displayorder>='0' AND fav.uid='$discuz_uid' ORDER BY t.lastpost DESC LIMIT 0, 3"); while($favthread = $sdb->fetch_array($query)) { echo "<a href=\"index.php?action=thread&amp;tid=$favthread[tid]\">".cutstr($favthread['subject'], 24)."</a><br />"; } echo "<br />$lang[my_fav_forum]<br />"; $query = $sdb->query("SELECT f.fid, f.name FROM {$tablepre}favorites fav, {$tablepre}forums f WHERE fav.uid='$discuz_uid' AND fav.fid=f.fid ORDER BY f.displayorder DESC LIMIT 0, 3"); while($favforum = $sdb->fetch_array($query)) { echo "<a href=\"index.php?action=forum&amp;fid=$favforum[fid]\">$favforum[name]</a><br />"; } echo '</p>'; } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/wap/include/my.inc.php
PHP
asf20
3,633
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: eccredit.php 20206 2009-09-22 02:37:49Z monkey $ */ define('NOROBOT', TRUE); define('CURSCRIPT', 'eccredit'); require_once './include/common.inc.php'; require_once DISCUZ_ROOT.'./include/ec_credit.func.php'; if(empty($action)) { $uid = intval($uid); $allowviewpro = $discuz_uid && $uid == $discuz_uid ? 1 : $allowviewpro; if(!$allowviewpro) { showmessage('group_nopermission', NULL, 'NOPERM'); } include_once DISCUZ_ROOT.'./forumdata/cache/cache_usergroups.php'; $discuz_action = 62; $member = $db->fetch_first("SELECT m.uid, mf.customstatus, m.username, m.groupid, mf.taobao, mf.alipay, mf.avatar, mf.avatarwidth, mf.avatarheight, mf.buyercredit, mf.sellercredit, m.regdate FROM {$tablepre}members m LEFT JOIN {$tablepre}memberfields mf USING(uid) WHERE m.uid='$uid'"); if(!$member) { showmessage('member_nonexistence', NULL, 'NOPERM'); } $member['avatar'] = '<div class="avatar">'.discuz_uc_avatar($member['uid']); if($_DCACHE['usergroups'][$member['groupid']]['groupavatar']) { $member['avatar'] .= '<br /><img src="'.$_DCACHE['usergroups'][$member['groupid']]['groupavatar'].'" border="0" alt="" />'; } $member['avatar'] .= '</div>'; $member['taobaoas'] = str_replace("'", '', addslashes($member['taobao'])); $member['regdate'] = gmdate($dateformat, $member['regdate'] + $timeoffset * 3600); $member['usernameenc'] = rawurlencode($member['username']); $member['buyerrank'] = 0; if($member['buyercredit']){ foreach($ec_credit['rank'] AS $level => $credit) { if($member['buyercredit'] <= $credit) { $member['buyerrank'] = $level; break; } } } $member['sellerrank'] = 0; if($member['sellercredit']){ foreach($ec_credit['rank'] AS $level => $credit) { if($member['sellercredit'] <= $credit) { $member['sellerrank'] = $level; break; } } } $query = $db->query("SELECT variable, value, expiration FROM {$tablepre}spacecaches WHERE uid='$uid' AND variable IN ('buyercredit', 'sellercredit')"); $caches = array(); while($cache = $db->fetch_array($query)) { $caches[$cache['variable']] = unserialize($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']) : ''; include template('ec_credit'); } elseif($action == 'list') { $from = !empty($from) && in_array($from, array('buyer', 'seller', 'myself')) ? $from : ''; $uid = !empty($uid) ? intval($uid) : ''; $sql = $from == 'myself' ? "raterid='$uid'" : "rateeid='$uid'"; $sql .= $from == 'buyer' ? ' AND type=0' : ($from == 'seller' ? ' AND type=1' : ''); $filter = !empty($filter) ? $filter : ''; switch($filter) { case 'thisweek': $sql .= " AND dateline>=$timestamp - 604800"; break; case 'thismonth': $sql .= " AND dateline>=$timestamp - 2592000"; break; case 'halfyear': $sql .= " AND dateline>=$timestamp - 15552000"; break; case 'before': $sql .= " AND dateline<$timestamp - 15552000"; break; default: $filter = ''; } $level = !empty($level) ? $level : ''; switch($level) { case 'good': $sql .= ' AND score=1'; break; case 'soso': $sql .= ' AND score=0'; break; case 'bad': $sql .= ' AND score=-1'; break; default: $level = ''; } $page = max(1, intval($page)); $start_limit = ($page - 1) * 10; $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}tradecomments WHERE $sql"); $multipage = multi($num, 10, $page, "eccredit.php?action=list&uid=$uid".($from ? "&from=$from" : NULL).($filter ? "&filter=$filter" : NULL).($level ? "&level=$level" : NULL)); $comments = array(); $query = $db->query("SELECT tc.*, tl.subject, tl.price, tl.credit FROM {$tablepre}tradecomments tc LEFT JOIN {$tablepre}tradelog tl ON tl.orderid=tc.orderid WHERE $sql ORDER BY dateline DESC LIMIT $start_limit, 10"); while($comment = $db->fetch_array($query)) { $comment['expiration'] = dgmdate("$dateformat $timeformat", $comment['dateline'] + $timeoffset * 3600 + 30 * 86400); $comment['dbdateline'] = $comment['dateline']; $comment['dateline'] = dgmdate("$dateformat $timeformat", $comment['dateline'] + $timeoffset * 3600); $comment['baseprice'] = sprintf('%0.2f', $comment['baseprice']); $comments[] = $comment; } include template('ec_list'); } elseif($action == 'rate' && $orderid && isset($type)) { require_once DISCUZ_ROOT.'./include/trade.func.php'; $type = intval($type); if(!$type) { $raterid = 'buyerid'; $ratee = 'seller'; $rateeid = 'sellerid'; } else { $raterid = 'sellerid'; $ratee = 'buyer'; $rateeid = 'buyerid'; } $order = $db->fetch_first("SELECT * FROM {$tablepre}tradelog WHERE orderid='$orderid' AND $raterid='$discuz_uid'"); if(!$order) { 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 = $discuz_uid == $order['buyerid'] ? $order['sellerid'] : $order['buyerid']; if(!submitcheck('ratesubmit')) { include template('ec_rate'); } else { $score = intval($score); $message = cutstr(dhtmlspecialchars($message), 200); $level = $score == 1 ? 'good' : ($score == 0 ? 'soso' : 'bad'); $pid = intval($order['pid']); $order = daddslashes($order, 1); $db->query("INSERT INTO {$tablepre}tradecomments (pid, orderid, type, raterid, rater, ratee, rateeid, score, message, dateline) VALUES ('$pid', '$orderid', '$type', '$discuz_uid', '$discuz_user', '$order[$ratee]', '$order[$rateeid]', '$score', '$message', '$timestamp')"); if(!$order['offline'] || $order['credit']) { if($db->result_first("SELECT COUNT(score) FROM {$tablepre}tradecomments WHERE raterid='$discuz_uid' AND type='$type'") < $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; } $db->query("UPDATE {$tablepre}tradelog SET ratestatus='$ratestatus' WHERE orderid='$order[orderid]'"); if($ratestatus != 3) { sendnotice($order[$rateeid], 'eccredit', 'threads'); } showmessage('eccredit_succeed'); } } elseif($action == 'explain' && $id) { $id = intval($id); if(!submitcheck('explainsubmit', 1)) { include template('ec_explain'); } else { $comment = $db->fetch_first("SELECT explanation, dateline FROM {$tablepre}tradecomments WHERE id='$id' AND rateeid='$discuz_uid'"); if(!$comment) { showmessage('eccredit_nofound'); } elseif($comment['explanation']) { showmessage('eccredit_reexplanation_repeat'); } elseif($comment['dateline'] < $timestamp - 30 * 86400) { showmessage('eccredit_reexplanation_closed'); } $explanation = cutstr(dhtmlspecialchars($explanation), 200); $db->query("UPDATE {$tablepre}tradecomments SET explanation='$explanation' WHERE id='$id'"); include_once language('misc'); showmessage("<script type=\"text/javascript\">\$('ecce_$id').innerHTML = '<font class=\"lighttxt\">$language[eccredit_explain]: ".addslashes($explanation)."</font>';hideMenu();</script>"); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/eccredit.php
PHP
asf20
8,112
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: admincp.php 20568 2009-10-09 09:38:53Z monkey $ */ define('IN_ADMINCP', TRUE); define('NOROBOT', TRUE); require_once './include/common.inc.php'; require_once DISCUZ_ROOT.'./admin/global.func.php'; require_once DISCUZ_ROOT.'./admin/cpanel.share.php'; require_once DISCUZ_ROOT.'./include/cache.func.php'; include language('admincp'); $discuz_action = 211; //$admincp['checkip'] && $onlineip = empty($_SERVER['REMOTE_ADDR']) ? getenv('REMOTE_ADDR') : $_SERVER['REMOTE_ADDR']; $adminsession = new AdminSession($discuz_uid, $groupid, $adminid, $onlineip); $dactionarray = $adminsession->get('dactionarray'); if($dactionarray === null) { $dactionarray = array(); if($radminid != $groupid) { $tmp = unserialize($db->result_first("SELECT disabledactions FROM {$tablepre}adminactions WHERE admingid='$groupid'")); $dactionarray = $tmp ? $tmp : array(); } $adminsession->set('dactionarray', $dactionarray, true); } $cpaccess = $adminsession->cpaccess; if($cpaccess == 0 || (!$discuz_secques && $admincp['forcesecques'])) { require_once DISCUZ_ROOT.'./admin/login.inc.php'; } elseif($cpaccess == 1) { if($admin_password != '') { require_once DISCUZ_ROOT.'./uc_client/client.php'; $ucresult = uc_user_login($discuz_uid, $admin_password, 1, 1, $admin_questionid, $admin_answer); if($ucresult[0] > 0) { $adminsession->errorcount = -1; $adminsession->update(); dheader('Location: '.$BASESCRIPT.'?'.cpurl('url', array('sid'))); } else { $adminsession->errorcount ++; $adminsession->update(); writelog('cplog', dhtmlspecialchars("$timestamp\t$discuz_userss\t$adminid\t$onlineip\t$action\tAUTHENTIFICATION(PASSWORD)")); } } require_once DISCUZ_ROOT.'./admin/login.inc.php'; } else { $username = !empty($username) ? dhtmlspecialchars($username) : ''; $action = !empty($action) && is_string($action) ? trim($action) : ''; $operation = !empty($operation) && is_string($operation) ? trim($operation) : ''; $page = isset($page) ? intval((max(1, $page))) : 0; if(!empty($action) && !in_array($action, array('main', 'logs'))) { switch($cpaccess) { case 1: $extralog = 'AUTHENTIFICATION(ERROR #'.intval($adminsession['errorcount']).')'; break; case 3: $extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'addsubmit', 'admin_password', 'sid', 'action')); break; default: $extralog = ''; } $extralog = trim(str_replace(array('GET={};', 'POST={};'), '', $extralog)); $extralog = $action == 'home' && isset($securyservice) ? '' : $extralog; writelog('cplog', implode("\t", clearlogstring(array($timestamp,$discuz_userss,$adminid,$onlineip,$action,$extralog)))); unset($extralog); } $isfounder = $adminsession->isfounder = isfounder(); if(empty($action) || isset($frames)) { $extra = cpurl('url'); $extra = $extra && $action ? $extra : (!empty($runwizard) ? 'action=runwizard' : 'action=home'); require_once DISCUZ_ROOT.'./admin/main.inc.php'; } elseif($action == 'logout') { $adminsession ->destroy(); dheader("Location: $indexname"); } else { checkacpaction($action, $operation); if(in_array($action, array('home', 'settings', 'members', 'profilefields', 'admingroups', 'usergroups', 'ranks', 'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'prune', 'styles', 'addons', 'plugins', 'tasks', 'magics', 'medals', 'google', 'qihoo', 'announce', 'faq', 'ec', 'tradelog', 'creditwizard', 'jswizard', 'project', 'counter', 'misc', 'adv', 'logs', 'tools', 'checktools', 'search', 'upgrade')) || ($isfounder && in_array($action, array('runwizard', 'templates', 'db')))) { require_once DISCUZ_ROOT.'./admin/'.$action.'.inc.php'; $title = 'cplog_'.$action.($operation ? '_'.$operation : ''); } else { cpheader(); cpmsg('noaccess'); } cpfooter(); } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/admincp.php
PHP
asf20
4,033
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: logging.php 20592 2009-10-10 06:37:56Z monkey $ */ define('NOROBOT', TRUE); define('CURSCRIPT', 'logging'); require_once './include/common.inc.php'; require_once DISCUZ_ROOT.'./include/misc.func.php'; require_once DISCUZ_ROOT.'./include/login.func.php'; require_once DISCUZ_ROOT.'./uc_client/client.php'; if($action == 'logout' && !empty($formhash)) { if($_DCACHE['settings']['frameon'] && $_DCOOKIE['frameon'] == 'yes') { $extrahead .= '<script>if(top != self) {parent.leftmenu.location.reload();}</script>'; } if($formhash != FORMHASH) { showmessage('logout_succeed', dreferer()); } $ucsynlogout = $allowsynlogin ? uc_user_synlogout() : ''; clearcookies(); $groupid = 7; $discuz_uid = 0; $discuz_user = $discuz_pw = ''; $styleid = $_DCACHE['settings']['styleid']; showmessage('logout_succeed', dreferer()); } elseif($action == 'seccode') { $seccodecheck = 1; include template('header_ajax'); include template('seccheck'); include template('footer_ajax'); } elseif($action == 'login') { if($discuz_uid) { $ucsynlogin = ''; showmessage('login_succeed', $indexname); } $field = $loginfield == 'uid' ? 'uid' : 'username'; if(!($loginperm = logincheck())) { showmessage('login_strike'); } $seccodecheck = $seccodestatus & 2; $seccodescript = ''; if($seccodecheck && $seccodedata['loginfailedcount']) { $seccodecheck = $db->result_first("SELECT count(*) FROM {$tablepre}failedlogins WHERE ip='$onlineip' AND count>='$seccodedata[loginfailedcount]' AND $timestamp-lastupdate<=900"); $seccodescript = '<script type="text/javascript" reload="1">if($(\'seccodelayer\').innerHTML == \'\') ajaxget(\'logging.php?action=seccode\', \'seccodelayer\');</script>'; } if(!submitcheck('loginsubmit', 1, $seccodecheck)) { $discuz_action = 6; $referer = dreferer(); $thetimenow = '(GMT '.($timeoffset > 0 ? '+' : '').$timeoffset.') '. dgmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600). $styleselect = ''; $query = $db->query("SELECT styleid, name FROM {$tablepre}styles WHERE available='1'"); while($styleinfo = $db->fetch_array($query)) { $styleselect .= "<option value=\"$styleinfo[styleid]\">$styleinfo[name]</option>\n"; } $cookietimecheck = !empty($_DCOOKIE['cookietime']) ? 'checked="checked"' : ''; if($seccodecheck) { $seccode = random(6, 1) + $seccode{0} * 1000000; } $username = !empty($_DCOOKIE['loginuser']) ? htmlspecialchars($_DCOOKIE['loginuser']) : ''; include template('login'); } else { $discuz_uid = 0; $discuz_user = $discuz_pw = $discuz_secques = ''; $result = userlogin(); if($result > 0) { $ucsynlogin = $allowsynlogin ? uc_user_synlogin($discuz_uid) : ''; if(!empty($inajax)) { $msgforward = unserialize($msgforward); $mrefreshtime = intval($msgforward['refreshtime']) * 1000; include_once DISCUZ_ROOT.'./forumdata/cache/cache_usergroups.php'; $usergroups = $_DCACHE['usergroups'][$groupid]['grouptitle']; $message = 1; include template('login'); } else { if($groupid == 8) { showmessage('login_succeed_inactive_member', 'memcp.php'); } else { showmessage('login_succeed', dreferer()); } } } elseif($result == -1) { $ucresult['username'] = addslashes($ucresult['username']); $auth = authcode("$ucresult[username]\t".FORMHASH, 'ENCODE'); if($inajax) { $message = 2; $location = $regname.'?action=activation&auth='.rawurlencode($auth); include template('login'); } else { showmessage('login_activation', $regname.'?action=activation&auth='.rawurlencode($auth)); } } else { $password = preg_replace("/^(.{".round(strlen($password) / 4)."})(.+?)(.{".round(strlen($password) / 6)."})$/s", "\\1***\\3", $password); $errorlog = dhtmlspecialchars( $timestamp."\t". ($ucresult['username'] ? $ucresult['username'] : stripslashes($username))."\t". $password."\t". ($secques ? "Ques #".intval($questionid) : '')."\t". $onlineip); writelog('illegallog', $errorlog); loginfailed($loginperm); $fmsg = $ucresult['uid'] == '-3' ? (empty($questionid) || $answer == '' ? 'login_question_empty' : 'login_question_invalid') : 'login_invalid'; showmessage($fmsg, 'logging.php?action=login'); } } } else { showmessage('undefined_action'); } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/logging.php
PHP
asf20
4,543
<?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: rss.php 20150 2009-09-21 01:46:30Z monkey $ */ //error_reporting(E_ERROR | E_WARNING | E_PARSE); error_reporting(0); define('IN_DISCUZ', TRUE); define('DISCUZ_ROOT', ''); $timestamp = time(); $fidarray = array(); if(PHP_VERSION < '4.1.0') { $_GET = &$HTTP_GET_VARS; $_SERVER = &$HTTP_SERVER_VARS; } require_once DISCUZ_ROOT.'./config.inc.php'; require_once DISCUZ_ROOT.'./include/global.func.php'; require_once DISCUZ_ROOT.'./include/db_'.$database.'.class.php'; require_once DISCUZ_ROOT.'./forumdata/cache/cache_settings.php'; require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php'; require_once DISCUZ_ROOT.'./forumdata/cache/style_'.intval($_DCACHE['settings']['styleid']).'.php'; if(!$_DCACHE['settings']['rssstatus']) { exit('RSS Disabled'); } $ttl = $_DCACHE['settings']['rssttl'] ? $_DCACHE['settings']['rssttl']: 30; $num = 20; $db = new dbstuff; $db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset); unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect); $groupid = 7; $discuz_uid = 0; $discuz_user = $discuz_pw = $discuz_secques = ''; if(!empty($_GET['auth'])) { list($uid, $fid, $auth) = explode("\t", authcode($_GET['auth'], 'DECODE', md5($_DCACHE['settings']['authkey']))); $member = $db->fetch_first("SELECT uid AS discuz_uid, username AS discuz_user, password AS discuz_pw, secques AS discuz_secques, groupid FROM {$tablepre}members WHERE uid='".intval($uid)."'"); if($member) { if($auth == substr(md5($member['discuz_pw'].$member['discuz_secques']), 0, 8)) { extract($member); } } } $PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $boardurl = 'http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF, 0, strrpos($PHP_SELF, '/') + 1); $bbname = dhtmlspecialchars(strip_tags($_DCACHE['settings']['bbname'])); $rssfid = empty($_GET['fid']) ? 0 : intval($_GET['fid']); $forumname = ''; if(empty($rssfid)) { foreach($_DCACHE['forums'] as $fid => $forum) { if(rssforumperm($forum)) { $fidarray[] = $fid; } } } else { $forum = isset($_DCACHE['forums'][$rssfid]) && $_DCACHE['forums'][$rssfid]['type'] != 'group' ? $_DCACHE['forums'][$rssfid] : array(); if($forum && rssforumperm($forum)) { $fidarray = array($rssfid); $forumname = dhtmlspecialchars($_DCACHE['forums'][$rssfid]['name']); } else { exit('Specified forum not found'); } } dheader("Content-type: application/xml"); echo "<?xml version=\"1.0\" encoding=\"".$charset."\"?>\n". "<rss version=\"2.0\">\n". " <channel>\n". (count($fidarray) > 1 ? " <title>$bbname</title>\n". " <link>{$boardurl}".$_DCACHE[settings][indexname]."</link>\n". " <description>Latest $num threads of all forums</description>\n" : " <title>$bbname - $forumname</title>\n". " <link>{$boardurl}forumdisplay.php?fid=$rssfid</link>\n". " <description>Latest $num threads of $forumname</description>\n" ). " <copyright>Copyright(C) $bbname</copyright>\n". " <generator>Discuz! Board by Comsenz Inc.</generator>\n". " <lastBuildDate>".gmdate('r', $timestamp)."</lastBuildDate>\n". " <ttl>$ttl</ttl>\n". " <image>\n". " <url>{$boardurl}images/logo.gif</url>\n". " <title>$bbname</title>\n". " <link>{$boardurl}</link>\n". " </image>\n"; if($fidarray) { $query = $db->query("SELECT * FROM {$tablepre}rsscaches WHERE fid IN (".implode(',', $fidarray).") ORDER BY dateline DESC LIMIT $num"); if($db->num_rows($query)) { while($thread = $db->fetch_array($query)) { if($timestamp - $thread['lastupdate'] > $ttl * 60) { updatersscache(); break; } else { echo " <item>\n". " <title>".dhtmlspecialchars($thread['subject'])."</title>\n". " <link>{$boardurl}viewthread.php?tid=$thread[tid]</link>\n". " <description><![CDATA[$thread[description]]]></description>\n". " <category>".dhtmlspecialchars($thread['forum'])."</category>\n". " <author>".dhtmlspecialchars($thread['author'])."</author>\n". " <pubDate>".gmdate('r', $thread['dateline'])."</pubDate>\n". " </item>\n"; } } } else { updatersscache(); } } echo " </channel>\n". "</rss>"; function rssforumperm($forum) { global $groupid, $discuz_uid; return $forum['type'] != 'group' && (!$forum['viewperm'] || ($forum['viewperm'] && forumperm($forum['viewperm'])) || $accessmasks); } function updatersscache() { global $_DCACHE, $timestamp, $num, $tablepre, $db; $db->query("DELETE FROM {$tablepre}rsscaches"); require_once DISCUZ_ROOT.'./include/post.func.php'; foreach($_DCACHE['forums'] as $fid => $forum) { if($forum['type'] != 'group') { $query = $db->query("SELECT t.tid, t.readperm, t.price, t.author, t.dateline, t.subject, p.message, p.status FROM {$tablepre}threads t LEFT JOIN {$tablepre}posts p ON p.tid=t.tid AND p.first='1' WHERE t.fid='$fid' AND t.displayorder>='0' ORDER BY t.dateline DESC LIMIT $num"); while($thread = $db->fetch_array($query)) { $forum['name'] = addslashes($forum['name']); $thread['author'] = $thread['author'] != '' ? addslashes($thread['author']) : 'Anonymous'; $thread['subject'] = addslashes($thread['subject']); $thread['description'] = $thread['readperm'] > 0 || $thread['price'] > 0 || $thread['status'] & 1 ? '' : addslashes(nl2br(messagecutstr($thread['message'], 250))); $db->query("REPLACE INTO {$tablepre}rsscaches (lastupdate, fid, tid, dateline, forum, author, subject, description) VALUES ('$timestamp', '$fid', '$thread[tid]', '$thread[dateline]', '$forum[name]', '$thread[author]', '$thread[subject]', '$thread[description]')"); } } } } ?>
zyyhong
trunk/jiaju001/newbbs/bbs/rss.php
PHP
asf20
5,897
//显示表情菜单 function showFace(showid, target) { var div = $('uchome_face_bg'); if(div) { div.parentNode.removeChild(div); } div = document.createElement('div'); div.id = 'uchome_face_bg'; div.style.position = 'absolute'; div.style.left = div.style.top = '0px'; div.style.width = '100%'; div.style.height = document.body.scrollHeight + 'px'; div.style.backgroundColor = '#FFFFFF'; div.style.zIndex = 10000; div.style.display = 'none'; div.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=0,finishOpacity=100,style=0)'; div.style.opacity = 0; div.onclick = function() { $(showid+'_menu').style.display = 'none'; $('uchome_face_bg').style.display = 'none'; } $('append_parent').appendChild(div); if($(showid + '_menu') != null) { $(showid+'_menu').style.display = ''; } else { var faceDiv = document.createElement("div"); faceDiv.id = showid+'_menu'; faceDiv.className = 'facebox'; faceDiv.style.position = 'absolute'; var faceul = document.createElement("ul"); for(i=1; i<31; i++) { var faceli = document.createElement("li"); faceli.innerHTML = '<img src="image/face/'+i+'.gif" onclick="insertFace(\''+showid+'\','+i+', \''+ target +'\')" style="cursor:pointer; position:relative;" />'; faceul.appendChild(faceli); } faceDiv.appendChild(faceul); $('append_parent').appendChild(faceDiv) } //定位菜单 setMenuPosition(showid, 0); div.style.display = ''; } //插入表情 function insertFace(showid, id, target) { var faceText = '[em:'+id+':]'; if($(target) != null) { insertContent(target, faceText); } $(showid+'_menu').style.display = 'none'; $('uchome_face_bg').style.display = 'none'; } function textCounter(obj, showid, maxlimit) { var len = strLen(obj.value); var showobj = $(showid); if(len > maxlimit) { obj.value = getStrbylen(obj.value, maxlimit); showobj.innerHTML = '0'; } else { showobj.innerHTML = maxlimit - len; } if(maxlimit - len > 0) { showobj.parentNode.style.color = ""; } else { showobj.parentNode.style.color = "red"; } } function getStrbylen(str, len) { var num = 0; var strlen = 0; var newstr = ""; var obj_value_arr = str.split(""); for(var i = 0; i < obj_value_arr.length; i ++) { if(i < len && num + byteLength(obj_value_arr[i]) <= len) { num += byteLength(obj_value_arr[i]); strlen = i + 1; } } if(str.length > strlen) { newstr = str.substr(0, strlen); } else { newstr = str; } return newstr; } function byteLength (sStr) { aMatch = sStr.match(/[^\x00-\x80]/g); return (sStr.length + (! aMatch ? 0 : aMatch.length)); } function strLen(str) { var charset = document.charset; 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; }
zyyhong
trunk/jiaju001/newbbs/home/source/script_face.js
JavaScript
asf20
2,904
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: class_xmlrpc.php 12844 2009-07-23 04:27:17Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } class xmlrpc { var $xmlserver; var $callback; var $xmlmessage; var $db; var $timestamp; var $member; function __construct() { global $_SGLOBAL,$_SC; $this->callback = $this->xmlrpcApi(); $this->xmlmessage = new stdClass(); $this->siteUrl = getsiteurl(); $this->db = $_SGLOBAL['db']; $this->charset = $_SC['charset']; $this->timestamp = $_SGLOBAL['timestamp']; } function xmlrpc() { $this->__construct(); } function xmlrpcSet() { return new xmlrpc(); } function xmlrpcServer() { if (phpversion() < '4.3.0') { $data = empty($GLOBALS['HTTP_RAW_POST_DATA'])?'':$GLOBALS['HTTP_RAW_POST_DATA']; } else { $data = file_get_contents("php://input"); } if(!$data) { $this->sendFault(1, 'Invalid Method Call'); } else { $data = addslashes($data); } $this->xmlmessage->structTypes = array(); $this->xmlmessage->structs = array(); $this->xmlmessage->struct_name = array(); if ($this->xmlrpcParse($data)) { $result = $this->xmlrpcCall($this->xmlmessage->methodname, $this->xmlmessage->params); $rxml = $this->xmlrpcValue($result); $outxml = $this->xmlrpcValueXML($rxml); $outxml = "<methodResponse><params><param><value>$outxml</value></param></params></methodResponse>"; $outxml = siconv($outxml,'UTF-8',$this->charset); $this->xmlrpcOutXML($outxml); } } function xmlrpcApi() { $api = array ( // MetaWeblog API 'metaWeblog.newPost' => 'newPost', 'metaWeblog.editPost' => 'editPost', 'metaWeblog.getPost' => 'getPost', 'metaWeblog.newMediaObject' => 'newMediaObject', 'metaWeblog.getCategories' => 'getCategories', 'metaWeblog.getRecentPosts' => 'getRecentPosts', //WordPress API 'mt.getCategoryList' => 'getCategoryList', 'mt.setPostCategories' => 'setPostCategories', // Blogger API 'blogger.getUsersBlogs' => 'getUserBlog', 'blogger.getUserInfo' => 'getUserInfo', 'blogger.deletePost' => 'deletePost', 'blogger.getPost' => 'getPost', 'blogger.getRecentPosts' => 'getRecentPosts', 'blogger.newPost' => 'newPost', 'blogger.editPost' => 'editPost' ); return $api; } function xmlrpcParse($data) { $this->xmlmessage->messages = preg_replace('/<\?xml(.*)?\?'.'>/', '', $data); if (trim($this->xmlmessage->messages) == '') { return false; } $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false); xml_set_object($parser, $this->xmlmessage); xml_set_element_handler($parser, array (& $this, 'xmltag_open'), array (& $this, 'xmltag_close')); xml_set_character_data_handler($parser, array (& $this, 'xml_data')); $message = $this->xmlmessage->messages; if (!xml_parse($parser, $message)) { return false; } xml_parser_free($parser); if ($this->xmlmessage->messageType == 'fault') { return false; } return true; } function xmltag_open($parser, $tag, $attr) { $this->xmlmessage->tag_content = ''; $this->xmlmessage->last_open = $tag; switch ($tag) { case 'methodCall' : case 'methodResponse' : case 'fault' : $this->xmlmessage->messageType = $tag; break; case 'data' : $this->xmlmessage->structTypes[] = 'array'; $this->xmlmessage->structs[] = array(); break; case 'struct' : $this->xmlmessage->structTypes[] = 'struct'; $this->xmlmessage->structs[] = array(); break; } } function xml_data($parser, $data) { $this->xmlmessage->tag_content .= $data; } function xmltag_close($parser, $tag) { $flag = false; switch ($tag) { case 'int' : case 'i4' : $value = intval(trim($this->xmlmessage->tag_content)); $flag = true; break; case 'double' : $value = (double) trim($this->xmlmessage->tag_content); $flag = true; break; case 'string' : $value = $this->xmlmessage->tag_content; $flag = true; break; case 'dateTime.iso8601' : $value = $this->convertDate($this->xmlmessage->tag_content); $flag = true; break; case 'value' : if (trim($this->xmlmessage->tag_content) != '' || $this->xmlmessage->last_open == 'value') { $value = (string) trim($this->xmlmessage->tag_content); $flag = true; } break; case 'boolean' : $value = (boolean) trim($this->xmlmessage->tag_content); $flag = true; break; case 'base64' : $value = saddslashes(base64_decode(trim($this->xmlmessage->tag_content))); $flag = true; break; case 'data' : case 'struct' : $value = array_pop($this->xmlmessage->structs); array_pop($this->xmlmessage->structTypes); $flag = true; break; case 'member' : array_pop($this->xmlmessage->struct_name); break; case 'name' : $this->xmlmessage->struct_name[] = trim($this->xmlmessage->tag_content); break; case 'methodName' : $this->xmlmessage->methodname = trim($this->xmlmessage->tag_content); break; } if ($flag) { if (count($this->xmlmessage->structs) > 0) { if ($this->xmlmessage->structTypes[count($this->xmlmessage->structTypes) - 1] == 'struct') { $this->xmlmessage->structs[count($this->xmlmessage->structs) - 1][$this->xmlmessage->struct_name[count($this->xmlmessage->struct_name) - 1]] = $value; } else { $this->xmlmessage->structs[count($this->xmlmessage->structs) - 1][] = $value; } } else { $this->xmlmessage->params[] = $value; } } if (!in_array($tag, array ('data', 'struct', 'member'))) { $this->xmlmessage->tag_content = ''; } } function xmlrpcValue($data, $type = false) { $value = new stdClass(); $value->data = $data; if (!$type) { $type = $this->xmlrpcType($value); } $value->type = $type; if ($type == 'struct') { foreach ($value->data as $key => $v) { $value->data[$key] = $this->xmlrpcValue($v); } } if ($type == 'array') { for ($i = 0, $j = count($value->data);$i < $j;$i++) { $value->data[$i] = $this->xmlrpcValue($value->data[$i]); } } return $value; } function xmlrpcValueXML($data) { switch ($data->type) { case 'boolean' : return '<boolean>'.($data->data) ? '1' : '0'.'</boolean>'; break; case 'int' : return '<int>'.$data->data.'</int>'; break; case 'double' : return '<double>'.$data->data.'</double>'; break; case 'string' : return '<string>'.htmlspecialchars($data->data).'</string>'; break; case 'array' : $return = '<array><data>'; foreach ($data->data as $item) { $return .= '<value>'.$this->xmlrpcValueXML($item).'</value>'; } $return .= '</data></array>'; return $return; break; case 'struct' : $return = '<struct>'."\n"; foreach ($data->data as $name => $item) { $return .= '<member><name>'.$name.'</name>'; $return .= '<value>'.$this->xmlrpcValueXML($item).'</value></member>'; } $return .= '</struct>'; return $return; break; case 'date' : return '<dateTime.iso8601>'.($data->data->date).'</dateTime.iso8601>'; break; case 'base64' : return '<base64>'.base64_encode($data->data).'</base64>'; break; default : break; } } function xmlrpcType(& $value) { if (is_bool($value->data)) { return 'boolean'; } if (is_double($value->data)) { return 'double'; } if (is_int($value->data)) { return 'int'; } if (is_array($value->data)) { return empty ($value->data) || range(0, count($value->data) - 1) === array_keys($value->data) ? 'array' : 'struct'; } if (is_object($value->data)) { if ($value->data->is_date) { return 'date'; } if ($value->data->is_base64) { return 'base64'; } $value->data = get_object_vars($value->data); return 'struct'; } return 'string'; } function xmlrpcCall($methodname, $args) { $func = $this->callback[$methodname]; return call_user_func_array(array(&$this, $func), $args); } function xmlrpcOutXML($xml) { $xml = '<?xml version="1.0" encoding="utf-8"?>'."\n".$xml; header('Connection: close'); header('Content-Length: '.strlen($xml)); header('Content-Type: text/xml'); header('Date: '.sgmdate('r')); echo $xml; exit(); } function sendFault($code = 0, $string = 'Error') { @header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="utf-8"?>'; echo '<methodResponse><fault><value><struct><member><name>faultCode</name><value><i4>'; echo $code; echo '</i4></value></member><member><name>faultString</name><value><string>'; echo $string; echo '</string></value></member></struct></value></fault></methodResponse>'; exit(); } function convertDate($time) { return sstrtotime($time); } function authUser($username, $password) { global $_SGLOBAL; $username = addslashes(siconv($username, $this->charset, 'UTF-8')); $password = addslashes(siconv($password, $this->charset, 'UTF-8')); if($this->member = getpassport($username, $password)) { $_SGLOBAL['supe_uid'] = $this->member['uid']; $this->member['username'] = addslashes($this->member['username']); $_SGLOBAL['supe_username'] = $this->member['username']; $_SGLOBAL['timestamp'] = $this->timestamp; return true; } else { $this->sendFault(1, 'Authoried Error.Please check your password.'); } } function getClassId($uid, $classname) { $class = array(); if($classname) { $classname = addslashes(siconv($classname, $this->charset, 'UTF-8')); $query = $this->db->query("SELECT classid FROM ".tname('class')." WHERE uid='$uid' AND classname='$classname'"); $class = $this->db->fetch_array($query); } return empty($class['classid'])?0:$class['classid']; } function getUserBlog($uid, $username, $password) { $this->authUser($username, $password); $struct = array(); $struct[] = array ( 'url' => $this->siteUrl.'space.php?uid='.$this->member['uid'].'&do=blog', 'blogid' => $this->member['uid'], 'blogName' => $this->member['username'].'\'s space' ); return $struct; } function getUserInfo($uid, $username, $password) { $this->authUser($username, $password); $struct = array( 'nickname' => $this->member['username'], 'userid' => $this->member['uid'], 'url' => $this->siteUrl.'space.php?uid='.$this->member['uid'], 'email' => '', 'lastname' => $this->member['username'], 'firstname' => '' ); return $struct; } function newMediaObject($uid, $username, $password, $mediaobject = array()) { global $_SGLOBAL, $space; $fileext = fileext($mediaobject['name']); if(!in_array($fileext, array('jpg', 'gif', 'png'))) { $this->sendFault(500, 'You should choose image file to upload.'); } $this->authUser($username, $password); include_once(S_ROOT.'./source/function_cp.php'); $struct = array(); if($stream_save = stream_save(sstripslashes($mediaobject['bits']),'0', $fileext)) { $struct['url'] = pic_get($stream_save['filepath'], $stream_save['thumb'], $stream_save['remote'], 0); } else { $this->sendFault(500, 'Sorry, your image could not be uploaded. Something wrong happened.'); } if(!preg_match("/^(http\:\/\/|\/)/i", $struct['url'])) $struct['url'] = $this->siteUrl.$struct['url']; return $struct; } function newPost($uid, $username, $password, $post, $publish = true) { return $this->opPost($username, $password, $post, 0); } function editPost($postid, $username, $password, $post, $publish = true) { return $this->opPost($username, $password, $post, $postid); } function opPost($username, $password, $post, $postid=0) { global $_SGLOBAL; $this->authUser($username, $password); $postid = intval($postid); include_once(S_ROOT.'./source/function_blog.php'); $uid = $this->member['uid']; $old_post = array(); if($postid) { $query = $this->db->query("SELECT bf.*, b.* FROM ".tname('blog')." b LEFT JOIN ".tname('blogfield')." bf ON bf.blogid=b.blogid WHERE b.blogid='$postid' AND b.uid='$uid'"); if(!$old_post = $this->db->fetch_array($query)) { $this->sendFault(500, 'Sorry, your entry could not be posted. Something wrong happened.'); } } $post['title'] = siconv($post['title'],$this->charset,'UTF-8'); $post['description'] = isset($post['content'])?$post['content']:$post['description']; $post['description'] = siconv($post['description'],$this->charset,'UTF-8'); $blog_post_data = array( 'classid' => intval($this->getClassId($uid, $post['categories'][0])), 'subject' => addslashes($post['title']), 'message' => addslashes($post['description']), 'tag' => addslashes(empty($post['tagwords'])?'':siconv(implode(' ', $post['tagwords']), $this->charset, 'UTF-8')) ); if($result = blog_post($blog_post_data, $old_post)) { return $result['blogid']; } else { $this->sendFault(500, 'Sorry, your entry could not be posted. Something wrong happened.'); } } function deletePost($blogname, $blogid, $username, $password, $boolean = true){ global $_SGLOBAL; $this->authUser($username, $password); include_once(S_ROOT.'./source/function_delete.php'); $blogid = intval($blogid); if(deleteblogs(array($blogid))) { return true; } else { return false; } } function getCategories($blogid, $username, $password) { $this->authUser($username, $password); $struct = array(); $struct[] = array ( 'description' => '', 'htmlUrl' => $this->siteUrl.'space.php?uid='.$blogid.'&ac=blogs', 'rssUrl' => '', 'title' => '', 'categoryid' => 0 ); $uid = $this->member['uid']; $query = $this->db->query("SELECT classid, classname FROM ".tname('class')." WHERE uid='$uid'"); while ($cats = $this->db->fetch_array($query)) { $struct[] = array ( 'description' => $cats['classname'], 'htmlUrl' => $this->siteUrl.'space.php?uid='.$blogid.'&ac=blogs&classid='.$cats['classid'], 'rssUrl' => '', 'title' => $cats['classname'], 'categoryid' => $cats['classid'] ); } return $struct; } function getCategoryList($uid, $username, $password) { $this->authUser($username, $password); $struct = array(); $struct[] = array ('categoryId' => 0, 'categoryName' => ''); $uid = $this->member['uid']; $query = $this->db->query("SELECT classid, classname FROM ".tname('class')." WHERE uid='$uid'"); while ($cats = $this->db->fetch_array($query)) { $struct[] = array ( 'categoryId' => $cats['classid'], 'categoryName' => $cats['classname'] ); } return $struct; } function getPost($postid, $username, $password) { $this->authUser($username, $password); $struct = array(); $postid = intval($postid); $uid = $this->member['uid']; $query = $this->db->query("SELECT bf.message, b.blogid, b.subject, b.dateline, c.classid, c.classname FROM ".tname('blog')." b LEFT JOIN ".tname('blogfield')." bf ON bf.blogid=b.blogid LEFT JOIN ".tname('class')." c ON c.classid=b.classid WHERE b.blogid='$postid' AND b.uid='$uid'"); if($item = $this->db->fetch_array($query)) { $item['dateline'] = sgmdate('Ymd\TH:i:s', $item['dateline']); $struct = array( 'userid' => $uid, 'dateCreated' => $item['dateline'], 'title' => $item['subject'], 'categories' => array($item['classname']), 'description' => $item['message'], 'content' => $item['message'] ); } return $struct; } function getRecentPosts($type, $username, $password, $num = 50) { $this->authUser($username, $password); $struct = array(); $uid = $this->member['uid']; $num = intval($num); if($num < 1) $num = 1; $query = $this->db->query("SELECT bf.message, b.blogid, b.subject, b.dateline FROM ".tname('blog')." b LEFT JOIN ".tname('blogfield')." bf ON bf.blogid=b.blogid WHERE b.uid ='$uid' ORDER BY b.dateline DESC LIMIT 0,$num"); while($item = $this->db->fetch_array($query)) { $item['dateline'] = sgmdate('Ymd\TH:i:s', $item['dateline']); $struct[] = array( 'postid' => $item['blogid'], 'userid' => $uid, 'dateCreated' => $item['dateline'], 'title' => $item['subject'], 'categories' => array($item['classname']), 'description' => $item['message'], 'content' => $item['message'] ); } return $struct; } } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/class_xmlrpc.php
PHP
asf20
16,759
/* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: calendar.js 17449 2008-12-22 08:58:53Z cnteacher $ */ 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 getposition(obj) { var r = new Array(); r['x'] = obj.offsetLeft; r['y'] = obj.offsetTop; while(obj = obj.offsetParent) { r['x'] += obj.offsetLeft; r['y'] += obj.offsetTop; } return r; } function loadcalendar() { s = ''; s += '<div id="calendar" style="display:none; position:absolute; z-index:100000;" onclick="doane(event)">'; s += '<div style="width: 210px;"><table cellspacing="0" cellpadding="0" width="100%" style="text-align: center;">'; s += '<tr align="center" id="calendar_week"><td><a href="###" onclick="refreshcalendar(yy, mm-1)" title="上一月">《</a></td><td colspan="5" style="text-align: center"><a href="###" onclick="showdiv(\'year\');doane(event)" class="dropmenu" title="点击选择年份" id="year"></a>&nbsp; - &nbsp;<a id="month" class="dropmenu" title="点击选择月份" href="###" onclick="showdiv(\'month\');doane(event)"></a></td><td><A href="###" onclick="refreshcalendar(yy, mm+1)" title="下一月">》</A></td></tr>'; s += '<tr id="calendar_header"><td>日</td><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td>六</td></tr>'; for(var i = 0; i < 6; i++) { s += '<tr>'; for(var j = 1; j <= 7; j++) s += "<td id=d" + (i * 7 + j) + " height=\"19\">0</td>"; s += "</tr>"; } s += '<tr id="hourminute"><td colspan="7" align="center"><input type="text" size="2" value="" id="hour" class="txt" onKeyUp=\'this.value=this.value > 23 ? 23 : zerofill(this.value);controlid.value=controlid.value.replace(/\\d+(\:\\d+)/ig, this.value+"$1")\'> 点 <input type="text" size="2" value="" id="minute" class="txt" onKeyUp=\'this.value=this.value > 59 ? 59 : zerofill(this.value);controlid.value=controlid.value.replace(/(\\d+\:)\\d+/ig, "$1"+this.value)\'> 分</td></tr>'; s += '</table></div></div>'; s += '<div id="calendar_year" onclick="doane(event)" style="display: none;z-index:100001;"><div class="col">'; for(var k = 2020; k >= 1931; k--) { s += k != 2020 && k % 10 == 0 ? '</div><div class="col">' : ''; s += '<a href="###" onclick="refreshcalendar(' + k + ', mm);$(\'calendar_year\').style.display=\'none\'"><span' + (today.getFullYear() == k ? ' class="calendar_today"' : '') + ' id="calendar_year_' + k + '">' + k + '</span></a><br />'; } s += '</div></div>'; s += '<div id="calendar_month" onclick="doane(event)" style="display: none;z-index:100001;">'; for(var k = 1; k <= 12; k++) { s += '<a href="###" onclick="refreshcalendar(yy, ' + (k - 1) + ');$(\'calendar_month\').style.display=\'none\'"><span' + (today.getMonth()+1 == k ? ' class="calendar_today"' : '') + ' id="calendar_month_' + k + '">' + k + ( k < 10 ? '&nbsp;' : '') + ' 月</span></a><br />'; } s += '</div>'; if(is_ie && is_ie < 7) { s += '<iframe id="calendariframe" frameborder="0" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"></iframe>'; s += '<iframe id="calendariframe_year" frameborder="0" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"></iframe>'; s += '<iframe id="calendariframe_month" frameborder="0" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"></iframe>'; } var div = document.createElement('div'); div.innerHTML = s; $('append_parent').appendChild(div); document.onclick = function(event) { $('calendar').style.display = 'none'; $('calendar_year').style.display = 'none'; $('calendar_month').style.display = 'none'; if(is_ie && is_ie < 7) { $('calendariframe').style.display = 'none'; $('calendariframe_year').style.display = 'none'; $('calendariframe_month').style.display = 'none'; } } $('calendar').onclick = function(event) { doane(event); $('calendar_year').style.display = 'none'; $('calendar_month').style.display = 'none'; if(is_ie && is_ie < 7) { $('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) { $('calendar').style.display = 'none'; $('calendar_month').style.display = 'none'; if(is_ie && is_ie < 7) { $('calendariframe').style.display = 'none'; } controlid.value = yy + "-" + zerofill(mm + 1) + "-" + zerofill(d) + (addtime ? ' ' + zerofill($('hour').value) + ':' + zerofill($('minute').value) : ''); } function showcalendar(event, controlid1, addtime1, startdate1, enddate1) { 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'; 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(is_ie && is_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'; } } 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 = "&nbsp;"; dd.className = ""; } while(x.getMonth() == mm) { dd = $("d" + (d + mv)); dd.innerHTML = '<a href="###" onclick="settime(' + d + ');return false">' + d + '</a>'; if((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 = "&nbsp;"; 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'; if(is_ie && is_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(); } /* 加载样式 */ var calendarstyle = "#calendar{padding:5px;text-align:left;border:1px solid #7FCAE2;background:#FFF;margin-bottom:0.8em;}#calendar td{padding:2px;font-weight:bold;}#calendar_week td{height:2em;line-height:2em;border-bottom:1px solid #E3EDF5;}#hourminute td{padding:4px 2px;border-top:1px solid #E3EDF5;}.calendar_expire,.calendar_expire a:link,.calendar_expire a:visited{color:#666;font-weight:normal;}.calendar_default,.calendar_default a:link,.calendar_default a:visited{color:#09C;}.calendar_checked,.calendar_checked a:link,.calendar_checked a:visited{color:#F60;font-weight:bold;}td.calendar_checked,span.calendar_checked{background:#E3EDF5;}.calendar_today,.calendar_today a:link,.calendar_today a:visited{color:#444;font-weight:bold;}#calendar_header td{width:30px;height:20px;border-bottom:1px solid #E3EDF5;font-weight:normal;}#calendar_year{display:none;line-height:130%;background:#FFF;position:absolute;z-index:10;}#calendar_year .col{float:left;background:#FFF;margin-left:1px;border:1px solid #E3EDF5;padding:4px;}#calendar_month{display:none;background:#FFF;line-height:130%;border:1px solid #DDD;padding:4px;position:absolute;z-index:11;}"; if(is_ie){// IE var el = document.createStyleSheet(); el.cssText = calendarstyle; } else { var el = document.createElement("style"); el.type = "text/css"; el.appendChild(document.createTextNode(calendarstyle)); document.getElementsByTagName("head")[0].appendChild(el); } loadcalendar();
zyyhong
trunk/jiaju001/newbbs/home/source/script_calendar.js
JavaScript
asf20
10,689
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_upload.js 13226 2009-08-24 02:39:06Z zhengqingpeng $ */ 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 aid = 0; var topicid = 0; var mainForm; var successState = false; var ieVersion = userAgent.substr(userAgent.indexOf('msie') + 5, 3); 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 = aid; var tags; tags = newnode.getElementsByTagName('form'); for(i in tags) { if(tags[i].id == 'upload') { tags[i].id = 'upload_' + id; } } tags = newnode.getElementsByTagName('input'); for(i in tags) { 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; } if(tags[i].id == 'topicid') { tags[i].id = 'topicid_' + id; } } tags = newnode.getElementsByTagName('span'); for(i in tags) { if(tags[i].id == 'localfile') { tags[i].id = 'localfile_' + id; } } aid++; $('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 = '<div class="borderbox"><table cellspacing="0" cellpadding="0" border="0"><tr>'; if(is_ie || userAgent.indexOf('firefox') >= 1) { var picPath = getPath($('attach_' + id)); var imgCache = new Image(); imgCache.src = picPath; inhtml += '<td><img src="' + picPath +'" width="60" height="80">&nbsp;</td>'; } if(is_ie && typeof no_insert=='undefined' || insertType==0) { localfile += '&nbsp;<a href="javascript:;" title="点击这里插入内容中当前光标的位置" onclick="insertAttachimgTag(' + id + ');return false;">[插入]</a>'; } localfile += '&nbsp;<span id="showmsg' + id + '"><a href="javascript:;" onclick="delAttach(' + id + ')">[删除]</a></span>'; inhtml += '<td>' + localfile +'<br/>'; inhtml += '图片描述:<br/><textarea name="pic_title" cols="40" rows="2"></textarea>'; inhtml += '</td></tr></table></div>'; $('localfile_' + id).innerHTML = inhtml; $('attach_' + id).style.display = 'none'; addAttach(); } function getPath(obj){ if (obj) { if (is_ie) { obj.select(); // IE下取得图片的本地路径 return document.selection.createRange().text; } else if(is_moz) { if (obj.files) { // Firefox下取得的是图片的数据 return obj.files.item(0).getAsDataURL(); } return obj.value; } 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) { if(insertType == 0) { insertImage(id); } else if(is_ie) { var picPath = getPath($('attach_' + id)); var imgCache = new Image(); imgCache.src = picPath; edit_insert('<img id="_uchome_localimg_' + id + '" src="' + picPath + '">'); } else { alert('对不起,请在IE浏览器下面使用本功能'); } } 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'+aid); if(uploadStat==1) { upobj.innerHTML = '上传成功'; successState = true; var InputNode; //两种生成方式,解决浏览器之间的兼容性问题 try { //IE模式下的创建方式,解决常规setAttribute设置属性带来的一些未知的错误 var InputNode = document.createElement("<input type=\"hidden\" id=\"picid_" + picid + "\" value=\""+ aid +"\" name=\"picids["+picid+"]\">"); } catch(e) { //非IE模式则须要用下列的常规setAttribute设置属性,否则生成的结果不能正常初始化 var InputNode = document.createElement("input"); InputNode.setAttribute("name", "picids["+picid+"]"); InputNode.setAttribute("type", "hidden"); InputNode.setAttribute("id", "picid_" + picid); InputNode.setAttribute("value", aid); } mainForm.appendChild(InputNode); } else { upobj.style.color = "#f00"; upobj.innerHTML = '上传失败 '+uploadStat; } } if($('showmsg'+nid) != null) { $('showmsg'+nid).innerHTML = '上传中,请等待(<a href="javascript:;" onclick="forms[nowUid].submit();">重试</a>)'; $('albumid_'+nid).value = albumid; if($('topicid_'+nid)) $('topicid_'+nid).value = topicid; 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; $('optopicid').value = topicid; if(!successState) return false; } mainForm.submit(); } aid = nid; nowUid++; uploadStat = 0; }
zyyhong
trunk/jiaju001/newbbs/home/source/script_upload.js
JavaScript
asf20
6,310
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_cookie.js 10737 2008-12-17 01:41:36Z zhengqingpeng $ */ Cookie = { /** Get a cookie's value * * @param integer key The token used to create the cookie * @return void */ get: function(key) { // Still not sure that "[a-zA-Z0-9.()=|%/]+($|;)" match *all* allowed characters in cookies tmp = document.cookie.match((new RegExp(key +'=[a-zA-Z0-9.()=|%/]+($|;)','g'))); if(!tmp || !tmp[0]) return null; else return unescape(tmp[0].substring(key.length+1,tmp[0].length).replace(';','')) || null; }, /** Set a cookie * * @param integer key The token that will be used to retrieve the cookie * @param string value The string to be stored * @param integer ttl Time To Live (hours) * @param string path Path in which the cookie is effective, default is "/" (optional) * @param string domain Domain where the cookie is effective, default is window.location.hostname (optional) * @param boolean secure Use SSL or not, default false (optional) * * @return setted cookie */ set: function(key, value, ttl, path, domain, secure) { cookie = [key+'='+ escape(value), 'path='+ ((!path || path=='') ? '/' : path), 'domain='+ ((!domain || domain=='')? window.location.hostname : domain)]; if (ttl) cookie.push('expires='+Cookie.hoursToExpireDate(ttl)); if (secure) cookie.push('secure'); return document.cookie = cookie.join('; '); }, /** Unset a cookie * * @param integer key The token that will be used to retrieve the cookie * @param string path Path used to create the cookie (optional) * @param string domain Domain used to create the cookie, default is null (optional) * @return void */ unset: function(key, path, domain) { path = (!path || typeof path != 'string') ? '' : path; domain = (!domain || typeof domain != 'string') ? '' : domain; if (Cookie.get(key)) Cookie.set(key, '', 'Thu, 01-Jan-70 00:00:01 GMT', path, domain); }, /** Return GTM date string of "now" + time to live * * @param integer ttl Time To Live (hours) * @return string */ hoursToExpireDate: function(ttl) { if (parseInt(ttl) == 'NaN' ) return ''; else { now = new Date(); now.setTime(now.getTime() + (parseInt(ttl) * 60 * 60 * 1000)); return now.toGMTString(); } }, /** Return true if cookie functionnalities are available * * @return boolean */ test: function() { Cookie.set('b49f729efde9b2578ea9f00563d06e57', 'true'); if (Cookie.get('b49f729efde9b2578ea9f00563d06e57') == 'true') { Cookie.unset('b49f729efde9b2578ea9f00563d06e57'); return true; } return false; }, /** If Firebug JavaScript console is present, it will dump cookie string to console. * * @return void */ dump: function() { if (typeof console != 'undefined') { console.log(document.cookie.split(';')); } } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_cookie.js
JavaScript
asf20
3,016
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_menu.js 12767 2009-07-20 06:01:49Z zhengqingpeng $ */ var jsmenu = new Array(); var ctrlobjclassName; jsmenu['active'] = new Array(); jsmenu['timer'] = new Array(); jsmenu['iframe'] = new Array(); function initCtrl(ctrlobj, click, duration, timeout, layer) { if(ctrlobj && !ctrlobj.initialized) { ctrlobj.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'][ctrlobj.id] = setTimeout('hideMenu(' + layer + ')', timeout); } ctrlobj.overfunc = typeof ctrlobj.onmouseover == 'function' ? ctrlobj.onmouseover : null; ctrlobj.onmouseover = function(e) { doane(e); if(this.overfunc) this.overfunc(); if(click) { clearTimeout(jsmenu['timer'][this.id]); } else { for(var id in jsmenu['timer']) { if(jsmenu['timer'][id]) clearTimeout(jsmenu['timer'][id]); } } } } } function initMenu(ctrlid, menuobj, duration, timeout, layer, drag) { if(menuobj && !menuobj.initialized) { menuobj.initialized = true; menuobj.ctrlkey = ctrlid; menuobj.onclick = ebygum; menuobj.style.position = 'absolute'; if(duration < 3) { if(duration > 1) { menuobj.onmouseover = function() { clearTimeout(jsmenu['timer'][ctrlid]); } } if(duration != 1) { menuobj.onmouseout = function() { jsmenu['timer'][ctrlid] = setTimeout('hideMenu(' + layer + ')', timeout); } } } menuobj.style.zIndex = 50; if(is_ie) { menuobj.style.filter += "progid:DXImageTransform.Microsoft.shadow(direction=135,color=#CCCCCC,strength=2)"; } if(drag) { menuobj.onmousedown = function(event) {try{menudrag(menuobj, event, 1);}catch(e){}}; document.body.onmousemove = function(event) {try{menudrag(menuobj, event, 2);}catch(e){}}; menuobj.onmouseup = function(event) {try{menudrag(menuobj, event, 3);}catch(e){}}; } } } var menudragstart = new Array(); function menudrag(menuobj, e, op) { if(op == 1) { if(in_array(is_ie ? event.srcElement.tagName : e.target.tagName, ['TEXTAREA', 'INPUT', 'BUTTON', 'SELECT'])) { return; } menudragstart = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY]; menudragstart[2] = parseInt(menuobj.style.left); menudragstart[3] = parseInt(menuobj.style.top); doane(e); } else if(op == 2 && menudragstart[0]) { var menudragnow = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY]; menuobj.style.left = (menudragstart[2] + menudragnow[0] - menudragstart[0]) + 'px'; menuobj.style.top = (menudragstart[3] + menudragnow[1] - menudragstart[1]) + 'px'; doane(e); } else if(op == 3) { menudragstart = []; doane(e); } } function showMenu(ctrlid, click, offset, duration, timeout, layer, showid, maxh, drag) { var ctrlobj = $(ctrlid); if(!ctrlobj) return; if(isUndefined(click)) click = false; if(isUndefined(offset)) offset = 0; if(isUndefined(duration)) duration = 2; if(isUndefined(timeout)) timeout = 250; if(isUndefined(layer)) layer = 0; if(isUndefined(showid)) showid = ctrlid; var showobj = $(showid); var menuobj = $(showid + '_menu'); if(!showobj|| !menuobj) return; if(isUndefined(maxh)) maxh = 1000; if(isUndefined(drag)) drag = false; if(click && jsmenu['active'][layer] == menuobj) { hideMenu(layer); return; } else { hideMenu(layer); } var len = jsmenu['timer'].length; if(len > 0) { for(var i=0; i<len; i++) { if(jsmenu['timer'][i]) clearTimeout(jsmenu['timer'][i]); } } initCtrl(ctrlobj, click, duration, timeout, layer); ctrlobjclassName = ctrlobj.className; ctrlobj.className += ' hover'; initMenu(ctrlid, menuobj, duration, timeout, layer, drag); menuobj.style.display = ''; if(!is_opera) { menuobj.style.clip = 'rect(auto, auto, auto, auto)'; } setMenuPosition(showid, offset); if(maxh && menuobj.scrollHeight > maxh) { menuobj.style.height = maxh + 'px'; if(is_opera) { menuobj.style.overflow = 'auto'; } else { menuobj.style.overflowY = 'auto'; } } if(!duration) { setTimeout('hideMenu(' + layer + ')', timeout); } jsmenu['active'][layer] = menuobj; } function setMenuPosition(showid, offset) { var showobj = $(showid); var menuobj = $(showid + '_menu'); if(isUndefined(offset)) offset = 0; if(showobj) { 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; var sTop = document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; if(offset != -1) { 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 > sTop + document.documentElement.clientHeight) && (showobj.Y - menuobj.h >= 0)) ? (showobj.Y - menuobj.h) + 'px' : showobj.Y + showobj.h + 'px'); } else if(offset == -1) { menuobj.style.left = (document.body.clientWidth-menuobj.w)/2 + 'px'; var divtop = sTop + (document.documentElement.clientHeight-menuobj.h)/2; if(divtop > 100) divtop = divtop - 100; menuobj.style.top = divtop + 'px'; } if(menuobj.style.clip && !is_opera) { menuobj.style.clip = 'rect(auto, auto, auto, auto)'; } } } function hideMenu(layer) { if(isUndefined(layer)) layer = 0; if(jsmenu['active'][layer]) { try { $(jsmenu['active'][layer].ctrlkey).className = ctrlobjclassName; } catch(e) {} clearTimeout(jsmenu['timer'][jsmenu['active'][layer].ctrlkey]); jsmenu['active'][layer].style.display = 'none'; if(is_ie && is_ie < 7 && jsmenu['iframe'][layer]) { jsmenu['iframe'][layer].style.display = 'none'; } jsmenu['active'][layer] = null; } } 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 ebygum(eventobj) { if(!eventobj || is_ie) { window.event.cancelBubble = true; return window.event; } else { if(eventobj.target.type == 'submit') { eventobj.target.form.submit(); } eventobj.stopPropagation(); return eventobj; } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_menu.js
JavaScript
asf20
6,790
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_ajax.js 12670 2009-07-14 07:43:56Z liguode $ */ var Ajaxs = new Array(); var AjaxStacks = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var ajaxpostHandle = 0; var evalscripts = new Array(); var ajaxpostresult = 0; function Ajax(recvType, waitId) { for(var stackId = 0; stackId < AjaxStacks.length && AjaxStacks[stackId] != 0; stackId++); AjaxStacks[stackId] = 1; var aj = new Object(); aj.loading = 'Loading...';//public aj.recvType = recvType ? recvType : 'XML';//public aj.waitId = waitId ? $(waitId) : null;//public aj.resultHandle = null;//private aj.sendString = '';//private aj.targetUrl = '';//private aj.stackId = 0; aj.stackId = stackId; 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, icount=versions.length; i<icount; i++) { try { request = new ActiveXObject(versions[i]); if(request) { return request; } } catch(e) {} } } return request; } aj.XMLHttpRequest = aj.createXMLHttpRequest(); aj.showLoading = function() { if(aj.waitId && (aj.XMLHttpRequest.readyState != 4 || aj.XMLHttpRequest.status != 200)) { changedisplay(aj.waitId, ''); aj.waitId.innerHTML = '<span><img src="image/loading.gif"> ' + aj.loading + '</span>'; } } aj.processHandle = function() { if(aj.XMLHttpRequest.readyState == 4 && aj.XMLHttpRequest.status == 200) { for(k in Ajaxs) { if(Ajaxs[k] == aj.targetUrl) { Ajaxs[k] = null; } } if(aj.waitId) changedisplay(aj.waitId, 'none'); if(aj.recvType == 'HTML') { aj.resultHandle(aj.XMLHttpRequest.responseText, aj); } else if(aj.recvType == 'XML') { try { aj.resultHandle(aj.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue, aj); } catch(e) { aj.resultHandle('', aj); } } AjaxStacks[aj.stackId] = 0; } } aj.get = function(targetUrl, resultHandle) { if(targetUrl.indexOf('?') != -1) { targetUrl = targetUrl + '&inajax=1'; } else { targetUrl = targetUrl + '?inajax=1'; } setTimeout(function(){aj.showLoading()}, 500); if(in_array(targetUrl, Ajaxs)) { return false; } else { Ajaxs.push(targetUrl); } aj.targetUrl = targetUrl; aj.XMLHttpRequest.onreadystatechange = aj.processHandle; aj.resultHandle = resultHandle; var delay = 100; if(window.XMLHttpRequest) { setTimeout(function(){ aj.XMLHttpRequest.open('GET', aj.targetUrl); aj.XMLHttpRequest.send(null);}, delay); } else { setTimeout(function(){ aj.XMLHttpRequest.open("GET", targetUrl, true); aj.XMLHttpRequest.send();}, delay); } } aj.post = function(targetUrl, sendString, resultHandle) { if(targetUrl.indexOf('?') != -1) { targetUrl = targetUrl + '&inajax=1'; } else { targetUrl = targetUrl + '?inajax=1'; } setTimeout(function(){aj.showLoading()}, 500); if(in_array(targetUrl, Ajaxs)) { return false; } else { Ajaxs.push(targetUrl); } 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.send(aj.sendString); } return aj; } function newfunction(func){ var args = new Array(); for(var i=1; i<arguments.length; i++) args.push(arguments[i]); return function(event){ doane(event); window[func].apply(window, args); return false; } } function changedisplay(obj, display) { if(display == 'auto') { obj.style.display = obj.style.display == '' ? 'none' : ''; } else { obj.style.display = display; } return false; } function evalscript(s) { if(s.indexOf('<script') == -1) return s; var p = /<script[^\>]*?>([^\x00]*?)<\/script>/ig; var arr = new Array(); while(arr = p.exec(s)) { var p1 = /<script[^\>]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i; var arr1 = new Array(); arr1 = p1.exec(arr[0]); if(arr1) { appendscript(arr1[1], '', arr1[2], arr1[3]); } else { p1 = /<script(.*?)>([^\x00]+?)<\/script>/i; arr1 = p1.exec(arr[0]); //获取字符集 var re = /charset=\"([\w\-]+?)\"/i; var charsetarr = re.exec(arr1[1]); appendscript('', arr1[2], arr1[1].indexOf('reload=') != -1, charsetarr[1]); } } return s; } 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; try { if(src) { scriptNode.src = src; } else if(text){ scriptNode.text = text; } $('append_parent').appendChild(scriptNode); } catch(e) {} } function stripscript(s) { return s.replace(/<script.*?>.*?<\/script>/ig, ''); } 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 ajaxget(url, showid, waitid) { waitid = typeof waitid == 'undefined' || waitid === null ? showid : waitid; var x = new Ajax(); x.setLoading(); x.setWaitId(waitid); x.display = ''; x.showId = $(showid); if(x.showId) x.showId.orgdisplay = typeof x.showId.orgdisplay === 'undefined' ? x.showId.style.display : x.showId.orgdisplay; 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) { evaled = false; if(s.indexOf('ajaxerror') != -1) { evalscript(s); evaled = true; } if(!evaled) { if(x.showId) { changedisplay(x.showId, x.showId.orgdisplay); changedisplay(x.showId, x.display); x.showId.orgdisplay = x.showId.style.display; ajaxinnerhtml(x.showId, s); ajaxupdateevents(x.showId); if(x.autogoto) scroll(0, x.showId.offsetTop); } } if(!evaled)evalscript(s); }); } function ajaxpost(formid, func, timeout) { showloading(); if(ajaxpostHandle != 0) { return false; } var ajaxframeid = 'ajaxframe'; var ajaxframe = $(ajaxframeid); if(ajaxframe == null) { if (is_ie && !is_opera) { ajaxframe = document.createElement("<iframe name='" + ajaxframeid + "' id='" + ajaxframeid + "'></iframe>"); } else { ajaxframe = document.createElement("iframe"); ajaxframe.name = ajaxframeid; ajaxframe.id = ajaxframeid; } ajaxframe.style.display = 'none'; $('append_parent').appendChild(ajaxframe); } $(formid).target = ajaxframeid; $(formid).action = $(formid).action + '&inajax=1'; ajaxpostHandle = [formid, func, timeout]; if(ajaxframe.attachEvent) { ajaxframe.detachEvent ('onload', ajaxpost_load); ajaxframe.attachEvent('onload', ajaxpost_load); } else { document.removeEventListener('load', ajaxpost_load, true); ajaxframe.addEventListener('load', ajaxpost_load, false); } $(formid).submit(); return false; } function ajaxpost_load() { var formid = ajaxpostHandle[0]; var func = ajaxpostHandle[1]; var timeout = ajaxpostHandle[2]; var formstatus = '__' + formid; showloading('none'); if(is_ie) { var s = $('ajaxframe').contentWindow.document.XMLDocument.text; } else { var s = $('ajaxframe').contentWindow.document.documentElement.firstChild.nodeValue; } evaled = false; if(s.indexOf('ajaxerror') != -1) { evalscript(s); evaled = true; } if(s.indexOf('ajaxok') != -1) { ajaxpostresult = 1; } else { ajaxpostresult = 0; } //function if(func) { setTimeout(func + '(\'' + formid + '\',' + ajaxpostresult + ')', 10); } if(!evaled && $(formstatus)) { $(formstatus).style.display = ''; ajaxinnerhtml($(formstatus), s); evalscript(s); } //层消失 if(timeout && ajaxpostresult) jsmenu['timer'][formid] = setTimeout("hideMenu()", timeout); formid.target = 'ajaxframe'; ajaxpostHandle = 0; } function ajaxmenu(e, ctrlid, isbox, timeout, func) { var offset = 0; var duration = 3; if(isUndefined(timeout)) timeout = 0; if(isUndefined(isbox)) isbox = 0; if(timeout>0) duration = 0; showloading(); if(jsmenu['active'][0] && jsmenu['active'][0].ctrlkey == ctrlid) { hideMenu(); doane(e); return; } else if(is_ie && is_ie < 7 && document.readyState.toLowerCase() != 'complete') { return; } if(isbox) { divclass = 'popupmenu_centerbox'; offset = -1; } else { divclass = 'popupmenu_popup'; } var div = $(ctrlid + '_menu'); if(!div) { div = document.createElement('div'); div.ctrlid = ctrlid; div.id = ctrlid + '_menu'; div.style.display = 'none'; div.className = divclass; $('append_parent').appendChild(div); } var x = new Ajax(); var href = !isUndefined($(ctrlid).href) ? $(ctrlid).href : $(ctrlid).attributes['href'].value; x.div = div; x.etype = e.type; x.get(href, function(s) { evaled = false; if(s.indexOf('ajaxerror') != -1) { evaled = true; } if(s.indexOf('hideMenu()') == -1) {//添加关闭 s = '<h1>消息</h1><a href="javascript:hideMenu();" class="float_del" title="关闭">关闭</a><div class="popupmenu_inner">' + s + '<div>'; } if(!evaled) { if(x.div) x.div.innerHTML = s; showMenu(ctrlid, x.etype == 'click', offset, duration, timeout, 0, ctrlid, 1000, true); //function if(func) { setTimeout(func + '(\'' + ctrlid + '\')', 10); } } evalscript(s); }); showloading('none'); doane(e); } //得到一个定长的hash值,依赖于 stringxor() 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<max; i++) { var k = s1.charCodeAt(i) ^ s2.charCodeAt(i); s += hash.charAt(k % 52); } return s; } function showloading(display, wating) { var display = display ? display : 'block'; var wating = wating ? wating : 'Loading...'; $('ajaxwaitid').innerHTML = wating; $('ajaxwaitid').style.display = display; } 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 = '<table><tbody id="'+showid.id+'_tbody">'+s+'</tbody></table>'; $('append_parent').appendChild(div1); var trs = div1.getElementsByTagName('TR'); var l = trs.length; for(var i=0; i<l; i++) { showid.appendChild(trs[0]); } var inputs = div1.getElementsByTagName('INPUT'); var l = inputs.length; for(var i=0; i<l; i++) { showid.appendChild(inputs[0]); } div1.parentNode.removeChild(div1); } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_ajax.js
JavaScript
asf20
12,941
function sAutoComplete(objName, showID, ulID, valID, series, func) { this.items = []; this.showObj = $(showID); this.ulObj = $(ulID); this.valObj = $(valID); if (!this.showObj) return; this.obj = objName; this.values = false; this.sVal = null; this.currently = -1; this.series = isUndefined(series) ? 1 : series; this.func = isUndefined(func) ? '': func; this.showObj.childNodes[0].scrollTop = 0; return this; }; sAutoComplete.prototype.addItem = function(items) { if(items.indexOf(",") > 0) { var itemArr = items.split(","); for(var i = 0; i < itemArr.length; i++) { this.items.push(itemArr[i]); } } else { this.items.push(items); } this.items.sort(); }; sAutoComplete.prototype.doClick = function(vObj) { with(this) { if(typeof vObj == 'undefined') return false; var val = valObj.value; instance = eval(obj); if(!this.series) { valObj.value = vObj.val; }else if(values) { if(valObj.value.lastIndexOf(",") != valObj.value.length-1) { valObj.value = valObj.value.substring(0, valObj.value.lastIndexOf(",")+1); } valObj.value += vObj.val + ","; } else { instance.values = true; valObj.value = vObj.val + ","; } if(this.func != '') { this.func(); } valObj.focus(); showObj.style.display = "none"; } }; sAutoComplete.prototype.directionKeyDown = function(event) { with(this) { var e = event.keyCode ? event.keyCode : event.which; var allChild = ulObj.childNodes.length; if(e == 40) { if(currently+1 >= allChild) currently = allChild - 2; currently++ if(currently != 0) showObj.childNodes[0].scrollTop += 16; ulObj.childNodes[currently].childNodes[0].style.cssText = "background: #2782D6; color: #FFF; text-decoration: none;"; } else if(e == 38) { if(currently - 1 <= -1) currently = 1; currently--; showObj.childNodes[0].scrollTop -= 16; ulObj.childNodes[currently].childNodes[0].style.cssText = "background: #2782D6; color: #FFF; text-decoration: none;"; } else if(e == 13) { instance = eval(obj); instance.doClick(ulObj.childNodes[currently]); } } }; sAutoComplete.prototype.append = function(item, filtrate) { with(this) { instance = eval(obj); var liObj = document.createElement("li"); liObj.onclick = function(){instance.doClick(this)}; liObj.val = item; if(filtrate) { var reg = new RegExp("(" + sVal + ")","ig"); if(sVal) liObj.innerHTML = '<a href="###">' + item.replace(reg , "<strong>$1</strong>") + '</a>'; } else { liObj.innerHTML = '<a href="###">' + item + '</a>'; } ulObj.appendChild(liObj); } }; sAutoComplete.prototype.handleEvent = function(searchVal, event) { with(this) { var hidden = true; var allVal = 0; var strArr = new Array(); var e = event.keyCode ? event.keyCode : event.which; ulObj.innerHTML = ""; showObj.style.display = "block"; instance = eval(obj); if(searchVal.indexOf(",") > 0) { strArr = searchVal.split(","); allVal = strArr.length; if(strArr[strArr.length-1] != "") { searchVal = strArr[strArr.length-1]; } else { searchVal = ""; } } if(searchVal != "") { searchVal = addslashes(searchVal); sVal = searchVal; var reg = new RegExp(searchVal, "ig"); var itemstr = ''; for(var i = 0; i < items.length; i++) { var itemstr = items[i]; if(itemstr.match(reg)) { instance.append(itemstr, 1); hidden = false; } } } else { for(var i = 0; i < items.length; i++) { instance.append(items[i], 0); hidden = false; } if(allVal == 0) instance.values = false; } if(hidden) { showObj.style.display = "none"; } else if(e == 38 || e == 40 || e == 13) { instance.directionKeyDown(event); } } }; function addslashes(str) { return preg_replace(['\\\\', '\\\'', '\\\/', '\\\(', '\\\)', '\\\[', '\\\]', '\\\{', '\\\}', '\\\^', '\\\$', '\\\?', '\\\.', '\\\*', '\\\+', '\\\|'], ['\\\\', '\\\'', '\\/', '\\(', '\\)', '\\[', '\\]', '\\{', '\\}', '\\^', '\\$', '\\?', '\\.', '\\*', '\\+', '\\|'], str); } function preg_replace(search, replace, str) { var len = search.length; for(var i = 0; i < len; i++) { re = new RegExp(search[i], "ig"); str = str.replace(re, typeof replace == 'string' ? replace : (replace[i] ? replace[i] : replace[0])); } return str; }
zyyhong
trunk/jiaju001/newbbs/home/source/script_autocomplete.js
JavaScript
asf20
4,389
var Drags = []; var nDrags = 1; var mouseOffset = null; var iMouseDown = false; var lMouseState = false; var dragObject = null; // Demo 0 variables var DragDrops = []; var curTarget = null; var lastTarget = null; var dragHelper = null; var tempDiv = null; var rootParent = null; var rootSibling = null; // Demo1 variables 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<arguments.length; i++){ var cObj = arguments[i]; DragDrops[cDrag].push(cObj); cObj.setAttribute('DropObj', cDrag); for(var j=0; j<cObj.childNodes.length; j++){ // Firefox puts in lots of #text nodes...skip these if(cObj.childNodes[j].nodeName=='#text') continue; cObj.childNodes[j].setAttribute('DragObj', cDrag); } } } function getPosition(e){ var left = 0; var top = 0; while (e.offsetParent){ left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0); top += e.offsetTop + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0); e = e.offsetParent; } left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0); top += e.offsetTop + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0); return {x:left, y:top}; } function mouseCoords(ev){ if(ev.pageX || ev.pageY){ return {x:ev.pageX, y:ev.pageY}; } return { x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, y:ev.clientY + document.body.scrollTop - document.body.clientTop }; } function writeHistory(object, message){ if(!object || !object.parentNode || !object.parentNode.getAttribute) return; var historyDiv = object.parentNode.getAttribute('history'); if(historyDiv){ historyDiv = document.getElementById(historyDiv); historyDiv.appendChild(document.createTextNode(object.id+': '+message)); historyDiv.appendChild(document.createElement('BR')); historyDiv.scrollTop += 50; } } function getMouseOffset(target, ev){ ev = ev || window.event; var docPos = getPosition(target); var mousePos = mouseCoords(ev); return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y}; } function mouseMove(ev){ ev = ev || window.event; var target = ev.target || ev.srcElement; var mousePos = mouseCoords(ev); if(Drags[0]){ if(lastTarget && (target!==lastTarget)){ writeHistory(lastTarget, 'Mouse Out Fired'); var origClass = lastTarget.getAttribute('origClass'); if(origClass) lastTarget.className = origClass; } var dragObj = target.getAttribute('DragObj'); if(dragObj!=null){ if(target!=lastTarget){ writeHistory(target, 'Mouse Over Fired'); var oClass = target.getAttribute('overClass'); if(oClass){ target.setAttribute('origClass', target.className); target.className = oClass; } } if(iMouseDown && !lMouseState){ writeHistory(target, 'Start Dragging'); curTarget = target; rootParent = curTarget.parentNode; rootSibling = curTarget.nextSibling; mouseOffset = getMouseOffset(target, ev); for(var i=0; i<dragHelper.childNodes.length; i++) dragHelper.removeChild(dragHelper.childNodes[i]); dragHelper.appendChild(curTarget.cloneNode(true)); dragHelper.style.display = 'block'; var dragClass = curTarget.getAttribute('dragClass'); if(dragClass){ dragHelper.firstChild.className = dragClass; } dragHelper.firstChild.removeAttribute('DragObj'); var dragConts = DragDrops[dragObj]; curTarget.setAttribute('startWidth', parseInt(curTarget.offsetWidth)); curTarget.setAttribute('startHeight', parseInt(curTarget.offsetHeight)); curTarget.style.display = 'none'; for(var i=0; i<dragConts.length; i++){ with(dragConts[i]){ var pos = getPosition(dragConts[i]); setAttribute('startWidth', parseInt(offsetWidth)); setAttribute('startHeight', parseInt(offsetHeight)); setAttribute('startLeft', pos.x); setAttribute('startTop', pos.y); } for(var j=0; j<dragConts[i].childNodes.length; j++){ with(dragConts[i].childNodes[j]){ if((nodeName=='#text') || (dragConts[i].childNodes[j]==curTarget)) continue; var pos = getPosition(dragConts[i].childNodes[j]); setAttribute('startWidth', parseInt(offsetWidth)); setAttribute('startHeight', parseInt(offsetHeight)); setAttribute('startLeft', pos.x); setAttribute('startTop', pos.y); } } } } } if(curTarget){ dragHelper.style.top = (mousePos.y - mouseOffset.y)+"px"; dragHelper.style.left = (mousePos.x - mouseOffset.x)+"px"; var dragConts = DragDrops[curTarget.getAttribute('DragObj')]; var activeCont = null; var xPos = mousePos.x - mouseOffset.x + (parseInt(curTarget.getAttribute('startWidth')) /2); var yPos = mousePos.y - mouseOffset.y + (parseInt(curTarget.getAttribute('startHeight'))/2); for(var i=0; i<dragConts.length; i++){ with(dragConts[i]){ if((parseInt(getAttribute('startLeft')) < xPos) && (parseInt(getAttribute('startTop')) < yPos) && ((parseInt(getAttribute('startLeft')) + parseInt(getAttribute('startWidth'))) > 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] = document.getElementById('Drags0'); if(Drags[0]){ CreateDragContainer(document.getElementById('DragContainer0')); } if(Drags[0]){ // Create our helper object that will show the item while dragging var cObj = $('content'); dragHelper = document.createElement('div'); dragHelper.style.cssText = 'position:absolute;display:none;'; cObj.parentNode.insertBefore(dragHelper, cObj); } } function mousedown(evnt){ }
zyyhong
trunk/jiaju001/newbbs/home/source/script_drag.js
JavaScript
asf20
9,442
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: cp_feed.php 12304 2009-06-03 07:29:34Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if(empty($_SCONFIG['videophoto'])) { showmessage('no_open_videophoto'); } $videophoto = $space['videostatus'] ? getvideopic($space['videopic']) : ''; include template("cp_videophoto"); ?>
zyyhong
trunk/jiaju001/newbbs/home/source/cp_videophoto.php
PHP
asf20
373
var ns = (navigator.appName.indexOf("Netscape") != -1); var d = document; function lsfloatdiv(id, sx, sy, floatid, bottom) { var adobj = $(id); if(!Cookie.get("closead")) { adobj.style.display = ""; } adobj.style.width = (document.body.clientWidth - (typeof(sx) == 'string' ? eval(sx) : sx)*2) + 'px'; adobj.style.left = (typeof(sx) == 'string' ? eval(sx) : sx) + 'px'; adobj.style.top = (typeof(sy) == 'string'? eval(sy) : sy) + 'px'; //设置两个紧贴主体两测 //$('couplet_left').style.left = ($('wrap').offsetLeft - 0) + 'px'; //$('couplet_rigth').style.left = ($('wrap').offsetLeft + $('wrap').offsetWidth+2) + 'px'; if(floatid != "" && bottom != 0) { document.getElementById(floatid).style.bottom = bottom + 'px'; } var el = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; var px = document.layers ? "" : "px"; window[id + "_obj"] = el; if(d.layers)el.style = el; el.cx = el.sx = sx;el.cy = el.sy = sy; el.sP = function(x, y) { this.style.left=x+px;this.style.top=y+px; }; el.floatIt = function() { var pX, pY; pX = (this.sx >= -4) ? 0 : ns ? innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth; pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; if(this.sy<0) pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight; this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8; this.sP(this.cx, this.cy); setTimeout(this.id + "_obj.floatIt()", 40); } //分辨率小于800*600隐藏浮动广告 var lengthobj = getWindowSize(); if(lengthobj.winWidth < 800) { closeBanner(id); } return el; } /** * 获取窗口的高度与宽度 */ function getWindowSize() { var winWidth = 0, winHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE winWidth = window.innerWidth; winHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' winWidth = document.documentElement.clientWidth; winHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible winWidth = document.body.clientWidth; winHeight = document.body.clientHeight; } return {winWidth:winWidth,winHeight:winHeight} } function closeBanner(id) { if(typeof($(id)) == 'object') { $(id).style.display = 'none'; Cookie.set("closead", 1); } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_couplet.js
JavaScript
asf20
2,873
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: inc_debug.php 10784 2008-12-22 07:57:02Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if(D_BUG && ckfounder($_SGLOBAL['supe_uid'])) { print<<<EOF <style> .tclass, .tclass2 { text-align:left;width:900px;border:0;border-collapse:collapse;margin-bottom:5px;table-layout: fixed; word-wrap: break-word;background:#FFF;} .tclass table, .tclass2 table {width:100%;border:0;table-layout: fixed; word-wrap: break-word;} .tclass table td, .tclass2 table td {border-bottom:0;border-right:0;border-color: #ADADAD;} .tclass th, .tclass2 th {border:1px solid #000;background:#CCC;padding: 2px;font-family: Courier New, Arial;font-size: 11px;} .tclass td, .tclass2 td {border:1px solid #000;background:#FFFCCC;padding: 2px;font-family: Courier New, Arial;font-size: 11px;} .tclass2 th {background:#D5EAEA;} .tclass2 td {background:#FFFFFF;} .firsttr td {border-top:0;} .firsttd {border-left:none !important;} .bold {font-weight:bold;} </style> <div id="uchome_debug" style="display:;"> EOF; $class = 'tclass2'; if(empty($_SGLOBAL['debug_query'])) $_SGLOBAL['debug_query'] = array(); foreach ($_SGLOBAL['debug_query'] as $dkey => $debug) { ($class == 'tclass')?$class = 'tclass2':$class = 'tclass'; echo '<table cellspacing="0" class="'.$class.'"><tr><th rowspan="2" width="20">'.($dkey+1).'</th><td width="60">'.$debug['time'].' ms</td><td class="bold">'.shtmlspecialchars($debug['sql']).'</td></tr>'; if(!empty($debug['info'])) { echo '<tr><td>Info</th><td>'.$debug['info'].'</td></tr>'; } if(!empty($debug['explain'])) { echo '<tr><td>Explain</td><td><table cellspacing="0"><tr class="firsttr"><td width="5%" class="firsttd">id</td><td width="10%">select_type</td><td width="12%">table</td><td width="5%">type</td><td width="20%">possible_keys</td><td width="10%">key</td><td width="8%">key_len</td><td width="5%">ref</td><td width="5%">rows</td><td width="20%">Extra</td></tr><tr>'; foreach ($debug['explain'] as $ekey => $explain) { ($ekey == 'id')?$tdclass = ' class="firsttd"':$tdclass=''; if(empty($explain)) $explain = '-'; echo '<td'.$tdclass.'>'.$explain.'</td>'; } echo '</tr></table></td></tr>'; } echo '</table>'; } if($values = $_COOKIE) { ($class == 'tclass')?$class = 'tclass2':$class = 'tclass'; $i = 1; echo '<table class="'.$class.'">'; foreach ($values as $ckey => $cookie) { echo '<tr><th width="20">'.$i.'</th><td width="250">$_COOKIE[\''.$ckey.'\']</td><td>'.$cookie.'</td></tr>'; $i++; } echo '</table>'; } if($files = get_included_files()) { ($class == 'tclass')?$class = 'tclass2':$class = 'tclass'; echo '<table class="'.$class.'">'; foreach ($files as $fkey => $file) { echo '<tr><th width="20">'.($fkey+1).'</th><td>'.$file.'</td></tr>'; } echo '</table>'; } if($values = $_SERVER) { ($class == 'tclass')?$class = 'tclass2':$class = 'tclass'; $i = 1; echo '<table class="'.$class.'">'; foreach ($values as $ckey => $cookie) { echo '<tr><th width="20">'.$i.'</th><td width="250">$_SERVER[\''.$ckey.'\']</td><td>'.$cookie.'</td></tr>'; $i++; } echo '</table>'; } echo '</div>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/inc_debug.php
PHP
asf20
3,204
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_city.js 11751 2009-03-23 10:20:50Z zhengqingpeng $ */ function setcity(provinceid, cityid) { var province = document.getElementById(provinceid).value; switch (province) { case "安徽" : var cityOptions = new Array( "合肥(*)", "合肥", "安庆", "安庆", "蚌埠", "蚌埠", "亳州", "亳州", "巢湖", "巢湖", "滁州", "滁州", "阜阳", "阜阳", "贵池", "贵池", "淮北", "淮北", "淮化", "淮化", "淮南", "淮南", "黄山", "黄山", "九华山", "九华山", "六安", "六安", "马鞍山", "马鞍山", "宿州", "宿州", "铜陵", "铜陵", "屯溪", "屯溪", "芜湖", "芜湖", "宣城", "宣城"); break; case "北京" : var cityOptions = new Array( "东城", "东城", "西城", "西城", "崇文", "崇文", "宣武", "宣武", "朝阳", "朝阳", "丰台", "丰台", "石景山", "石景山", "海淀", "海淀", "门头沟", "门头沟", "房山", "房山", "通州", "通州", "顺义", "顺义", "昌平", "昌平", "大兴", "大兴", "平谷", "平谷", "怀柔", "怀柔", "密云", "密云", "延庆", "延庆"); break; case "重庆" : var cityOptions = new Array( "万州", "万州", "涪陵", "涪陵", "渝中", "渝中", "大渡口", "大渡口", "江北", "江北", "沙坪坝", "沙坪坝", "九龙坡","九龙坡", "南岸", "南岸", "北碚", "北碚", "万盛", "万盛", "双挢", "双挢", "渝北", "渝北", "巴南", "巴南", "黔江", "黔江", "长寿", "长寿", "綦江", "綦江", "潼南", "潼南", "铜梁", "铜梁", "大足", "大足", "荣昌", "荣昌", "壁山", "壁山", "梁平", "梁平", "城口", "城口", "丰都", "丰都", "垫江", "垫江", "武隆", "武隆", "忠县", "忠县", "开县", "开县", "云阳", "云阳", "奉节", "奉节", "巫山", "巫山", "巫溪", "巫溪", "石柱", "石柱", "秀山", "秀山", "酉阳", "酉阳", "彭水", "彭水", "江津", "江津", "合川", "合川", "永川", "永川", "南川", "南川"); break; case "福建" : var cityOptions = new Array( "福州(*)", "福州", "福安", "福安", "龙岩", "龙岩", "南平", "南平", "宁德", "宁德", "莆田", "莆田", "泉州", "泉州", "三明", "三明", "邵武", "邵武", "石狮", "石狮", "晋江", "晋江", "永安", "永安", "武夷山", "武夷山", "厦门", "厦门", "漳州", "漳州"); break; case "甘肃" : var cityOptions = new Array( "兰州(*)", "兰州", "白银", "白银", "定西", "定西", "敦煌", "敦煌", "甘南", "甘南", "金昌", "金昌", "酒泉", "酒泉", "临夏", "临夏", "平凉", "平凉", "天水", "天水", "武都", "武都", "武威", "武威", "西峰", "西峰", "嘉峪关","嘉峪关", "张掖", "张掖"); break; case "广东" : var cityOptions = new Array( "广州(*)", "广州", "潮阳", "潮阳", "潮州", "潮州", "澄海", "澄海", "东莞", "东莞", "佛山", "佛山", "河源", "河源", "惠州", "惠州", "江门", "江门", "揭阳", "揭阳", "开平", "开平", "茂名", "茂名", "梅州", "梅州", "清远", "清远", "汕头", "汕头", "汕尾", "汕尾", "韶关", "韶关", "深圳", "深圳", "顺德", "顺德", "阳江", "阳江", "英德", "英德", "云浮", "云浮", "增城", "增城", "湛江", "湛江", "肇庆", "肇庆", "中山", "中山", "珠海", "珠海"); break; case "广西" : var cityOptions = new Array( "南宁(*)", "南宁", "百色", "百色", "北海", "北海", "桂林", "桂林", "防城港", "防城港", "河池", "河池", "贺州", "贺州", "柳州", "柳州", "来宾", "来宾", "钦州", "钦州", "梧州", "梧州", "贵港", "贵港", "玉林", "玉林"); break; case "贵州" : var cityOptions = new Array( "贵阳(*)", "贵阳", "安顺", "安顺", "毕节", "毕节", "都匀", "都匀", "凯里", "凯里", "六盘水", "六盘水", "铜仁", "铜仁", "兴义", "兴义", "玉屏", "玉屏", "遵义", "遵义"); break; case "海南" : var cityOptions = new Array( "海口(*)", "海口", "三亚", "三亚", "五指山", "五指山", "琼海", "琼海", "儋州", "儋州", "文昌", "文昌", "万宁", "万宁", "东方", "东方", "定安", "定安", "屯昌", "屯昌", "澄迈", "澄迈", "临高", "临高", "万宁", "万宁", "白沙黎族", "白沙黎族", "昌江黎族", "昌江黎族", "乐东黎族", "乐东黎族", "陵水黎族", "陵水黎族", "保亭黎族", "保亭黎族", "琼中黎族", "琼中黎族", "西沙群岛", "西沙群岛", "南沙群岛", "南沙群岛", "中沙群岛", "中沙群岛" ); break; case "河北" : var cityOptions = new Array( "石家庄(*)", "石家庄", "保定", "保定", "北戴河", "北戴河", "沧州", "沧州", "承德", "承德", "丰润", "丰润", "邯郸", "邯郸", "衡水", "衡水", "廊坊", "廊坊", "南戴河", "南戴河", "秦皇岛", "秦皇岛", "唐山", "唐山", "新城", "新城", "邢台", "邢台", "张家口", "张家口"); break; case "黑龙江" : var cityOptions = new Array( "哈尔滨(*)", "哈尔滨", "北安", "北安", "大庆", "大庆", "大兴安岭", "大兴安岭", "鹤岗", "鹤岗", "黑河", "黑河", "佳木斯", "佳木斯", "鸡西", "鸡西", "牡丹江", "牡丹江", "齐齐哈尔", "齐齐哈尔", "七台河", "七台河", "双鸭山", "双鸭山", "绥化", "绥化", "伊春", "伊春"); break; case "河南" : var cityOptions = new Array( "郑州(*)", "郑州", "安阳", "安阳", "鹤壁", "鹤壁", "潢川", "潢川", "焦作", "焦作", "济源", "济源", "开封", "开封", "漯河", "漯河", "洛阳", "洛阳", "南阳", "南阳", "平顶山", "平顶山", "濮阳", "濮阳", "三门峡", "三门峡", "商丘", "商丘", "新乡", "新乡", "信阳", "信阳", "许昌", "许昌", "周口", "周口", "驻马店", "驻马店"); break; case "香港" : var cityOptions = new Array( "香港", "香港", "九龙", "九龙", "新界", "新界"); break; case "湖北" : var cityOptions = new Array( "武汉(*)", "武汉", "恩施", "恩施", "鄂州", "鄂州", "黄冈", "黄冈", "黄石", "黄石", "荆门", "荆门", "荆州", "荆州", "潜江", "潜江", "十堰", "十堰", "随州", "随州", "武穴", "武穴", "仙桃", "仙桃", "咸宁", "咸宁", "襄阳", "襄阳", "襄樊", "襄樊", "孝感", "孝感", "宜昌", "宜昌"); break; case "湖南" : var cityOptions = new Array( "长沙(*)", "长沙", "常德", "常德", "郴州", "郴州", "衡阳", "衡阳", "怀化", "怀化", "吉首", "吉首", "娄底", "娄底", "邵阳", "邵阳", "湘潭", "湘潭", "益阳", "益阳", "岳阳", "岳阳", "永州", "永州", "张家界", "张家界", "株洲", "株洲"); break; case "江苏" : var cityOptions = new Array( "南京(*)", "南京", "常熟", "常熟", "常州", "常州", "海门", "海门", "淮安", "淮安", "江都", "江都", "江阴", "江阴", "昆山", "昆山", "连云港", "连云港", "南通", "南通", "启东", "启东", "沭阳", "沭阳", "宿迁", "宿迁", "苏州", "苏州", "太仓", "太仓", "泰州", "泰州", "同里", "同里", "无锡", "无锡", "徐州", "徐州", "盐城", "盐城", "扬州", "扬州", "宜兴", "宜兴", "仪征", "仪征", "张家港", "张家港", "镇江", "镇江", "周庄", "周庄"); break; case "江西" : var cityOptions = new Array( "南昌(*)", "南昌", "抚州", "抚州", "赣州", "赣州", "吉安", "吉安", "景德镇", "景德镇", "井冈山", "井冈山", "九江", "九江", "庐山", "庐山", "萍乡", "萍乡", "上饶", "上饶", "新余", "新余", "宜春", "宜春", "鹰潭", "鹰潭"); break; case "吉林" : var cityOptions = new Array( "长春(*)", "长春", "白城", "白城", "白山", "白山", "珲春", "珲春", "辽源", "辽源", "梅河", "梅河", "吉林", "吉林", "四平", "四平", "松原", "松原", "通化", "通化", "延吉", "延吉"); break; case "辽宁" : var cityOptions = new Array( "沈阳(*)", "沈阳", "鞍山", "鞍山", "本溪", "本溪", "朝阳", "朝阳", "大连", "大连", "丹东", "丹东", "抚顺", "抚顺", "阜新", "阜新", "葫芦岛", "葫芦岛", "锦州", "锦州", "辽阳", "辽阳", "盘锦", "盘锦", "铁岭", "铁岭", "营口", "营口"); break; case "澳门" : var cityOptions = new Array( "澳门", "澳门"); break; case "内蒙古" : var cityOptions = new Array( "呼和浩特(*)", "呼和浩特", "阿拉善盟", "阿拉善盟", "包头", "包头", "赤峰", "赤峰", "东胜", "东胜", "海拉尔", "海拉尔", "集宁", "集宁", "临河", "临河", "通辽", "通辽", "乌海", "乌海", "乌兰浩特", "乌兰浩特", "锡林浩特", "锡林浩特"); break; case "宁夏" : var cityOptions = new Array( "银川(*)", "银川", "固原", "固原", "中卫", "中卫", "石嘴山", "石嘴山", "吴忠", "吴忠"); break; case "青海" : var cityOptions = new Array( "西宁(*)", "西宁", "德令哈", "德令哈", "格尔木", "格尔木", "共和", "共和", "海东", "海东", "海晏", "海晏", "玛沁", "玛沁", "同仁", "同仁", "玉树", "玉树"); break; case "山东" : var cityOptions = new Array( "济南(*)", "济南", "滨州", "滨州", "兖州", "兖州", "德州", "德州", "东营", "东营", "菏泽", "菏泽", "济宁", "济宁", "莱芜", "莱芜", "聊城", "聊城", "临沂", "临沂", "蓬莱", "蓬莱", "青岛", "青岛", "曲阜", "曲阜", "日照", "日照", "泰安", "泰安", "潍坊", "潍坊", "威海", "威海", "烟台", "烟台", "枣庄", "枣庄", "淄博", "淄博"); break; case "上海" : var cityOptions = new Array( "崇明", "崇明", "黄浦", "黄浦", "卢湾", "卢湾", "徐汇", "徐汇", "长宁", "长宁", "静安", "静安", "普陀", "普陀", "闸北", "闸北", "虹口", "虹口", "杨浦", "杨浦", "闵行", "闵行", "宝山", "宝山", "嘉定", "嘉定", "浦东", "浦东", "金山", "金山", "松江", "松江", "青浦", "青浦", "南汇", "南汇", "奉贤", "奉贤", "朱家角", "朱家角"); break; case "山西" : var cityOptions = new Array( "太原(*)", "太原", "长治", "长治", "大同", "大同", "候马", "候马", "晋城", "晋城", "离石", "离石", "临汾", "临汾", "宁武", "宁武", "朔州", "朔州", "忻州", "忻州", "阳泉", "阳泉", "榆次", "榆次", "运城", "运城"); break; case "陕西" : var cityOptions = new Array( "西安(*)", "西安", "安康", "安康", "宝鸡", "宝鸡", "汉中", "汉中", "渭南", "渭南", "商州", "商州", "绥德", "绥德", "铜川", "铜川", "咸阳", "咸阳", "延安", "延安", "榆林", "榆林"); break; case "四川" : var cityOptions = new Array( "成都(*)", "成都", "巴中", "巴中", "达州", "达州", "德阳", "德阳", "都江堰", "都江堰", "峨眉山", "峨眉山", "涪陵", "涪陵", "广安", "广安", "广元", "广元", "九寨沟", "九寨沟", "康定", "康定", "乐山", "乐山", "泸州", "泸州", "马尔康", "马尔康", "绵阳", "绵阳", "眉山", "眉山", "南充", "南充", "内江", "内江", "攀枝花", "攀枝花", "遂宁", "遂宁", "汶川", "汶川", "西昌", "西昌", "雅安", "雅安", "宜宾", "宜宾", "自贡", "自贡", "资阳", "资阳"); break; case "台湾" : var cityOptions = new Array( "台北(*)", "台北", "基隆", "基隆", "台南", "台南", "台中", "台中", "高雄", "高雄", "屏东", "屏东", "南投", "南投", "云林", "云林", "新竹", "新竹", "彰化", "彰化", "苗栗", "苗栗", "嘉义", "嘉义", "花莲", "花莲", "桃园", "桃园", "宜兰", "宜兰", "台东", "台东", "金门", "金门", "马祖", "马祖", "澎湖", "澎湖", "其它", "其它"); break; case "天津" : var cityOptions = new Array( "天津", "天津", "和平", "和平", "东丽", "东丽", "河东", "河东", "西青", "西青", "河西", "河西", "津南", "津南", "南开", "南开", "北辰", "北辰", "河北", "河北", "武清", "武清", "红挢", "红挢", "塘沽", "塘沽", "汉沽", "汉沽", "大港", "大港", "宁河", "宁河", "静海", "静海", "宝坻", "宝坻", "蓟县", "蓟县" ); break; case "新疆" : var cityOptions = new Array( "乌鲁木齐(*)", "乌鲁木齐", "阿克苏", "阿克苏", "阿勒泰", "阿勒泰", "阿图什", "阿图什", "博乐", "博乐", "昌吉", "昌吉", "东山", "东山", "哈密", "哈密", "和田", "和田", "喀什", "喀什", "克拉玛依", "克拉玛依", "库车", "库车", "库尔勒", "库尔勒", "奎屯", "奎屯", "石河子", "石河子", "塔城", "塔城", "吐鲁番", "吐鲁番", "伊宁", "伊宁"); break; case "西藏" : var cityOptions = new Array( "拉萨(*)", "拉萨", "阿里", "阿里", "昌都", "昌都", "林芝", "林芝", "那曲", "那曲", "日喀则", "日喀则", "山南", "山南"); break; case "云南" : var cityOptions = new Array( "昆明(*)", "昆明", "大理", "大理", "保山", "保山", "楚雄", "楚雄", "大理", "大理", "东川", "东川", "个旧", "个旧", "景洪", "景洪", "开远", "开远", "临沧", "临沧", "丽江", "丽江", "六库", "六库", "潞西", "潞西", "曲靖", "曲靖", "思茅", "思茅", "文山", "文山", "西双版纳", "西双版纳", "玉溪", "玉溪", "中甸", "中甸", "昭通", "昭通"); break; case "浙江" : var cityOptions = new Array( "杭州(*)", "杭州", "安吉", "安吉", "慈溪", "慈溪", "定海", "定海", "奉化", "奉化", "海盐", "海盐", "黄岩", "黄岩", "湖州", "湖州", "嘉兴", "嘉兴", "金华", "金华", "临安", "临安", "临海", "临海", "丽水", "丽水", "宁波", "宁波", "瓯海", "瓯海", "平湖", "平湖", "千岛湖", "千岛湖", "衢州", "衢州", "江山", "江山", "瑞安", "瑞安", "绍兴", "绍兴", "嵊州", "嵊州", "台州", "台州", "温岭", "温岭", "温州", "温州", "余姚", "余姚", "舟山", "舟山"); break; case "海外" : var cityOptions = new Array( "美国(*)", "美国", "英国", "英国", "法国", "法国", "瑞士", "瑞士", "澳洲", "澳洲", "新西兰", "新西兰", "加拿大", "加拿大", "奥地利", "奥地利", "韩国", "韩国", "日本", "日本", "德国", "德国", "意大利", "意大利", "西班牙", "西班牙", "俄罗斯", "俄罗斯", "泰国", "泰国", "印度", "印度", "荷兰", "荷兰", "新加坡", "新加坡", "欧洲", "欧洲", "北美", "北美", "南美", "南美", "亚洲", "亚洲", "非洲", "非洲", "大洋洲", "大洋洲"); break; default: var cityOptions = new Array("选择城市", ""); break; } var cityObject = document.getElementById(cityid); cityObject.options.length = 0; cityObject.options[0] = new Option("选择城市", ""); var j = 0; for(var i = 0; i < cityOptions.length/2; i++) { j = i + 1; cityObject.options[j] = new Option(cityOptions[i*2],cityOptions[i*2+1]); } } function initprovcity(provinceid, province) { var provObject = document.getElementById(provinceid); for(var i = 0; i < provObject.options.length; i++) { if (provObject.options[i].value == province) { provObject.selectedIndex = i; break; } } //setcity(provinceid, cityid); } function showprovince(provinceid, cityid, province, boxid) { var provinces = new Array( "北京", "上海", "重庆", "安徽", "福建", "甘肃", "广东", "广西", "贵州", "海南", "河北", "黑龙江", "河南", "香港", "湖北", "湖南", "江苏", "江西", "吉林", "辽宁", "澳门", "内蒙古", "宁夏", "青海", "山东", "山西", "陕西", "四川", "台湾", "天津", "新疆", "西藏", "云南", "浙江", "海外" ); var selObj = document.createElement("select"); selObj.name = provinceid; selObj.id = provinceid; selObj.onchange = function() { setcity(provinceid, cityid); }; $(boxid).appendChild(selObj); selObj.options[0] = new Option("选择省份", ""); var j = 0; for(var i = 0; i < provinces.length; i++) { j = i + 1; selObj.options[j] = new Option(provinces[i], provinces[i]); } initprovcity(provinceid, province); } function showcity(cityid, city, provinceid, boxid) { if(isUndefined(provinceid)) provinceid = ''; var selObj = document.createElement("select"); selObj.name = cityid; selObj.id = cityid; $(boxid).appendChild(selObj); if(city == "") { selObj.options[0] = new Option("选择城市", ""); } else { selObj.options[0] = new Option(city, city); } if(provinceid != '') { setcity(provinceid, cityid); initprovcity(cityid, city); } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_city.js
JavaScript
asf20
24,932
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_manage.js 13178 2009-08-17 02:36:39Z liguode $ */ //添加留言 function wall_add(cid, result) { if(result) { var obj = $('comment_ul'); var newli = document.createElement("div"); var x = new Ajax(); x.get('do.php?ac=ajax&op=comment', function(s){ newli.innerHTML = s; }); obj.insertBefore(newli, obj.firstChild); if($('comment_message')) { $('comment_message').value= ''; } //提示获得积分 showreward(); } } //添加分享 function share_add(sid, result) { if(result) { var obj = $('share_ul'); var newli = document.createElement("div"); var x = new Ajax(); x.get('do.php?ac=ajax&op=share', function(s){ newli.innerHTML = s; }); obj.insertBefore(newli, obj.firstChild); $('share_link').value = 'http://'; $('share_general').value = ''; //提示获得积分 showreward(); } } //添加评论 function comment_add(id, result) { if(result) { var obj = $('comment_ul'); var newli = document.createElement("div"); var x = new Ajax(); x.get('do.php?ac=ajax&op=comment', function(s){ newli.innerHTML = s; }); if($('comment_prepend')){ obj = obj.firstChild; while (obj && obj.nodeType != 1){ obj = obj.nextSibling; } obj.parentNode.insertBefore(newli, obj); } else { obj.appendChild(newli); } if($('comment_message')) { $('comment_message').value= ''; } if($('comment_replynum')) { var a = parseInt($('comment_replynum').innerHTML); var b = a + 1; $('comment_replynum').innerHTML = b + ''; } //提示获得积分 showreward(); } } //编辑 function comment_edit(id, result) { if(result) { var ids = explode('_', id); var cid = ids[1]; var obj = $('comment_'+ cid +'_li'); var x = new Ajax(); x.get('do.php?ac=ajax&op=comment&cid='+ cid, function(s){ obj.innerHTML = s; }); } } //删除 function comment_delete(id, result) { if(result) { var ids = explode('_', id); var cid = ids[1]; var obj = $('comment_'+ cid +'_li'); obj.style.display = "none"; if($('comment_replynum')) { var a = parseInt($('comment_replynum').innerHTML); var b = a - 1; $('comment_replynum').innerHTML = b + ''; } } } //删除feed function feed_delete(id, result) { if(result) { var ids = explode('_', id); var feedid = ids[1]; var obj = $('feed_'+ feedid +'_li'); obj.style.display = "none"; } } //删除分享 function share_delete(id, result) { if(result) { var ids = explode('_', id); var sid = ids[1]; var obj = $('share_'+ sid +'_li'); obj.style.display = "none"; } } //删除好友 function friend_delete(id, result) { if(result) { var ids = explode('_', id); var uid = ids[1]; var obj = $('friend_'+ uid +'_li'); if(obj != null) obj.style.display = "none"; var obj2 = $('friend_tbody_'+uid); if(obj2 != null) obj2.style.display = "none"; } } //更改分组 function friend_changegroup(id, result) { if(result) { var ids = explode('_', id); var uid = ids[1]; var obj = $('friend_group_'+ uid); var x = new Ajax(); x.get('do.php?ac=ajax&op=getfriendgroup&uid='+uid, function(s){ obj.innerHTML = s; }); } } //更改分组名 function friend_changegroupname(id, result) { if(result) { var ids = explode('_', id); var group = ids[1]; var obj = $('friend_groupname_'+ group); var x = new Ajax(); x.get('do.php?ac=ajax&op=getfriendname&group='+group, function(s){ obj.innerHTML = s; }); } } //添加回帖 function post_add(pid, result) { if(result) { var obj = $('post_ul'); var newli = document.createElement("div"); var x = new Ajax(); x.get('do.php?ac=ajax&op=post', function(s){ newli.innerHTML = s; }); obj.appendChild(newli); if($('message')) { $('message').value= ''; newnode = $('quickpostimg').rows[0].cloneNode(true); tags = newnode.getElementsByTagName('input'); for(i in tags) { if(tags[i].name == 'pics[]') { tags[i].value = 'http://'; } } var allRows = $('quickpostimg').rows; while(allRows.length) { $('quickpostimg').removeChild(allRows[0]); } $('quickpostimg').appendChild(newnode); } if($('post_replynum')) { var a = parseInt($('post_replynum').innerHTML); var b = a + 1; $('post_replynum').innerHTML = b + ''; } //提示获得积分 showreward(); } } //编辑回帖 function post_edit(id, result) { if(result) { var ids = explode('_', id); var pid = ids[1]; var obj = $('post_'+ pid +'_li'); var x = new Ajax(); x.get('do.php?ac=ajax&op=post&pid='+ pid, function(s){ obj.innerHTML = s; }); } } //删除回帖 function post_delete(id, result) { if(result) { var ids = explode('_', id); var pid = ids[1]; var obj = $('post_'+ pid +'_li'); obj.style.display = "none"; if($('post_replynum')) { var a = parseInt($('post_replynum').innerHTML); var b = a - 1; $('post_replynum').innerHTML = b + ''; } } } //打招呼 function poke_send(id, result) { if(result) { var ids = explode('_', id); var uid = ids[1]; if($('poke_'+ uid)) { $('poke_'+ uid).style.display = "none"; } //提示获得积分 showreward(); } } //好友请求 function myfriend_post(id, result) { if(result) { var ids = explode('_', id); var uid = ids[1]; $('friend_'+uid).innerHTML = '<p>你们现在是好友了,接下来,您还可以:<a href="space.php?uid='+uid+'#comment" target="_blank">给TA留言</a> ,或者 <a href="cp.php?ac=poke&op=send&uid='+uid+'" id="a_poke_'+uid+'" onclick="ajaxmenu(event, this.id, 1)">打个招呼</a></p>'; } } //删除好友请求 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 picView(albumid) { if(albumid == 'none') { $('albumpic_body').innerHTML = ''; } else { ajaxget('do.php?ac=ajax&op=album&id='+albumid+'&ajaxdiv=albumpic_body', 'albumpic_body'); } } //删除重发邮件 function resend_mail(id, result) { if(result) { var ids = explode('_', id); var mid = ids[1]; var obj = $('sendmail_'+ mid +'_li'); obj.style.display = "none"; } } //设置应用不可见 function userapp_delete(id, result) { if(result) { var ids = explode('_', id); var appid = ids[1]; $('space_app_'+appid).style.display = "none"; } } //do评论 function docomment_get(id, result) { if(result) { var ids = explode('_', id); var doid = ids[1]; var showid = 'docomment_'+doid; var opid = 'do_a_op_'+doid; $(showid).style.display = ''; $(showid).className = 'sub_doing'; ajaxget('cp.php?ac=doing&op=getcomment&doid='+doid, showid); if($(opid)) { $(opid).innerHTML = '收起'; $(opid).onclick = function() { docomment_colse(doid); } } //提示获得积分 showreward(); } } function docomment_colse(doid) { var showid = 'docomment_'+doid; var opid = 'do_a_op_'+doid; $(showid).style.display = 'none'; $(showid).style.className = ''; $(opid).innerHTML = '回复'; $(opid).onclick = function() { docomment_get(showid, 1); } } function docomment_form(doid, id) { var showid = 'docomment_form_'+doid+'_'+id; var divid = 'docomment_' + doid; ajaxget('cp.php?ac=doing&op=docomment&doid='+doid+'&id='+id, showid); if($(divid)) { $(divid).style.display = ''; } } function docomment_form_close(doid, id) { var showid = 'docomment_form_'+doid+'_'+id; $(showid).innerHTML = ''; } //feed评论 function feedcomment_get(feedid, result) { var showid = 'feedcomment_'+feedid; var opid = 'feedcomment_a_op_'+feedid; $(showid).style.display = ''; $(showid).className = 'fcomment'; ajaxget('cp.php?ac=feed&op=getcomment&feedid='+feedid, showid); if($(opid) != null) { $(opid).innerHTML = '收起'; $(opid).onclick = function() { feedcomment_close(feedid); } } } function feedcomment_add(id, result) { if(result) { var ids = explode('_', id); var cid = ids[1]; var obj = $('comment_ol_'+cid); var newli = document.createElement("div"); var x = new Ajax(); x.get('do.php?ac=ajax&op=comment', function(s){ newli.innerHTML = s; }); obj.appendChild(newli); $('feedmessage_'+cid).value= ''; //提示获得积分 showreward(); } } //关闭评论 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 = '&laquo; 收起列表'; $(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 = '&raquo; 更多动态'; $(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(id) { var ids = id.split('_'); var idtype = ids[1]; var id = ids[2]; var clickid = ids[3]; ajaxget('cp.php?ac=click&op=show&clickid='+clickid+'&idtype='+idtype+'&id='+id, 'click_div'); //提示获得积分 showreward(); } //feed菜单 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(){ $('birthday').length=0; for(var i=0;i<28;i++){ $('birthday').options.add(new Option(i+1, i+1)); } if($('birthmonth').value!="2"){ $('birthday').options.add(new Option(29, 29)); $('birthday').options.add(new Option(30, 30)); switch($('birthmonth').value){ case "1": case "3": case "5": case "7": case "8": case "10": case "12":{ $('birthday').options.add(new Option(31, 31)); } } } else if($('birthyear').value!="") { var nbirthyear=$('birthyear').value; if(nbirthyear%400==0 || nbirthyear%4==0 && nbirthyear%100!=0) $('birthday').options.add(new Option(29, 29)); } } /** * 插入涂鸦 * @param String fid: 要关闭的层ID * @param String oid: 要插入到对象的目标ID * @param String url: 涂鸦文件的地址 * @param String tid: 切换标签ID * @param String from: 涂鸦从哪来的 * @return 没有返回值 */ function setDoodle(fid, oid, url, tid, from) { if(tid == null) { hideMenu(); } else { //用于两标签切换用 $(tid).style.display = ''; $(fid).style.display = 'none'; } var doodleText = '[img]'+url+'[/img]'; if($(oid) != null) { if(from == "editor") { insertImage(url); } else { insertContent(oid, doodleText); } } } function selCommentTab(hid, sid) { $(hid).style.display = 'none'; $(sid).style.display = ''; } //文字闪烁 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<L; i++) window.mcHandler.elements[i].style.color = color; } } window.mcHandler.elements.push(elem); if(window.mcHandler.timer == undefined) { window.mcHandler.timer = setInterval(window.mcHandler.run, 500); } } //隐私密码 function passwordShow(value) { if(value==4) { $('span_password').style.display = ''; $('tb_selectgroup').style.display = 'none'; } else if(value==2) { $('span_password').style.display = 'none'; $('tb_selectgroup').style.display = ''; } else { $('span_password').style.display = 'none'; $('tb_selectgroup').style.display = 'none'; } } //隐私特定好友 function getgroup(gid) { if(gid) { var x = new Ajax(); x.get('cp.php?ac=privacy&op=getgroup&gid='+gid, function(s){ s = s + ' '; $('target_names').innerHTML += s; }); } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_manage.js
JavaScript
asf20
13,250
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: blog.php 11056 2009-02-09 01:59:47Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $blogcount = getcount('blog', array('uid'=>$space['uid'])); if($blogcount) { $task['done'] = 1;//任务完成 } else { //任务完成向导 $task['guide'] = ' <strong>请按照以下的说明来参与本任务:</strong> <ul> <li>1. <a href="cp.php?ac=blog" target="_blank">新窗口打开发表日志页面</a>;</li> <li>2. 在新打开的页面中,书写自己的第一篇日志,并进行发布。</li> </ul>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/blog.php
PHP
asf20
632
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: invite.php 12304 2009-06-03 07:29:34Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } //用户任务完成标识变量 $task['done'] //任务完成结果html存储变量 $task['result'] //用户任务向导html存储变量 $task['guide'] $query = $_SGLOBAL['db']->query("SELECT COUNT(*) FROM ".tname('invite')." WHERE uid='$space[uid]' AND fuid>'0'"); $count = $_SGLOBAL['db']->result($query, 0); if($count >= 10) { $task['done'] = 1;//任务完成 } else { //任务完成向导 if($count) { $task['guide'] .= '<p style="color:red;">哇,厉害,您现在已经邀请了 '.$count.' 个好友了。继续努力!</p><br>'; } $task['guide'] .= '<strong>请按照以下的说明来完成本任务:</strong> <ul class="task"> <li>在新窗口中打开<a href="cp.php?ac=invite" target="_blank">好友邀请页面</a>;</li> <li>通过QQ、MSN等IM工具,或者发送邮件,把邀请链接告诉你的好友,邀请他们加入进来吧;</li> <li>您需要邀请10个好友才算完成。</li> </ul>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/invite.php
PHP
asf20
1,158
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: sample.php 11056 2009-02-09 01:59:47Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } //内置变量:$task['done'] (完成标识变量) $task['result'] (结果文字) $task['guide'] (向导文字) //判断用户是否完成了任务 $done = 0; //--------------------------------------------------- // 编写代码,判读用户是否完成任务要求 $done = 1; //--------------------------------------------------- if($done) { $task['done'] = 1;//任务完成 $task['result'] = '......';//用户参与任务看到的文字说明。支持html代码 } else { //任务完成向导 $task['guide'] = '......'; //指导用户如何参与任务的文字说明。支持html代码 } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/sample.php
PHP
asf20
804
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: email.php 12304 2009-06-03 07:29:34Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if($space['emailcheck']) { $task['done'] = 1;//任务完成 } else { //任务完成向导 $task['guide'] = ' <strong>请按照以下的说明来参与本任务:</strong> <ul> <li><a href="cp.php?ac=profile&op=contact" target="_blank">新窗口打开账号设置页面</a>;</li> <li>在新打开的设置页面中,将自己的邮箱真实填写,并点击“验证邮箱”按钮;</li> <li>几分钟后,系统会给你发送一封邮件,收到邮件后,请按照邮件的说明,访问邮件中的验证链接就可以了。</li> </ul>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/email.php
PHP
asf20
768
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: profile.php 13217 2009-08-21 06:57:53Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } //判断用户是否全部设置了个人资料 $nones = array(); $profile_lang = array( 'name' => '姓名', 'sex' => '性别', 'birthyear' => '生日(年)', 'birthmonth' => '生日(月)', 'birthday' => '生日(日)', 'blood' => '血型', 'marry' => '婚恋状态', 'birthprovince' => '家乡(省)', 'birthcity' => '家乡(市)', 'resideprovince' => '居住地(省)', 'residecity' => '居住地(市)' ); foreach (array('name','sex','birthyear','birthmonth','birthday','marry','birthprovince','birthcity','resideprovince','residecity') as $key) { $value = trim($space[$key]); if(empty($value)) { $nones[] = $profile_lang[$key]; } } //站长扩展 @include_once(S_ROOT.'./data/data_profilefield.php'); foreach ($_SGLOBAL['profilefield'] as $field => $value) { if($value['required'] && empty($space['field_'.$field])) { $nones[] = $value['title']; } } if(empty($nones)) { $task['done'] = 1;//任务完成 //自动找好友 $findmaxnum = 10; $space['friends'][] = $space['uid']; $nouids = implode(',', $space['friends']); //居住地好友 $residelist = array(); $warr = array(); $warr[] = "sf.resideprovince='".addslashes($space['resideprovince'])."'"; $warr[] = "sf.residecity='".addslashes($space['residecity'])."'"; $query = $_SGLOBAL['db']->query("SELECT s.uid,s.username,s.name,s.namestatus FROM ".tname('spacefield')." sf LEFT JOIN ".tname('space')." s ON s.uid=sf.uid WHERE ".implode(' AND ', $warr)." AND sf.uid NOT IN ($nouids) LIMIT 0,$findmaxnum"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']); $residelist[] = $value; } //性别好友 $sexlist = array(); $warr = array(); if(empty($space['marry']) || $space['marry'] < 2) {//单身 $warr[] = "sf.marry='1'";//单身 } if(empty($space['sex']) || $space['sex'] < 2) {//男生 $warr[] = "sf.sex='2'";//女生 } else { $warr[] = "sf.sex='1'";//男生 } $query = $_SGLOBAL['db']->query("SELECT s.uid,s.username,s.name,s.namestatus FROM ".tname('spacefield')." sf LEFT JOIN ".tname('space')." s ON s.uid=sf.uid WHERE ".implode(' AND ', $warr)." AND sf.uid NOT IN ($nouids) LIMIT 0,$findmaxnum"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']); $sexlist[] = $value; } realname_get(); if($residelist) { $task['result'] .= '<p>为您找到同城的会员,赶快加为好友吧:</p>'; $task['result'] .= '<ul class="avatar_list">'; foreach ($residelist as $key => $value) { $task['result'] .= '<li> <div class="avatar48"><a href="space.php?uid='.$value['uid'].'" target="_blank">'.avatar($value['uid'], 'small').'</a></div> <p><a href="space.php?uid='.$value['uid'].'" target="_blank">'.$_SN[$value['uid']].'</a></p> <p><a href="cp.php?ac=friend&op=add&uid='.$value['uid'].'" id="a_reside_friend_'.$key.'" onclick="ajaxmenu(event, this.id, 1)">加为好友</a></p> </li>'; } $task['result'] .= '</ul>'; } if($sexlist) { $task['result'] .= '<p>为您找到异性热门会员,赶快加为好友吧:</p>'; $task['result'] .= '<ul class="avatar_list">'; foreach ($sexlist as $key => $value) { $task['result'] .= '<li> <div class="avatar48"><a href="space.php?uid='.$value['uid'].'" target="_blank">'.avatar($value['uid'], 'small').'</a></div> <p><a href="space.php?uid='.$value['uid'].'" target="_blank">'.$_SN[$value['uid']].'</a></p> <p><a href="cp.php?ac=friend&op=add&uid='.$value['uid'].'" id="a_sex_friend_'.$key.'" onclick="ajaxmenu(event, this.id, 1)">加为好友</a></p> </li>'; } $task['result'] .= '</ul>'; } } else { //任务完成向导 $task['guide'] = ' <strong>您还有以下个人资料项需要补充完整:</strong><br> <span style="color:red;">'.implode('<br>', $nones).'</span><br><br> <strong>请按照以下的说明来完成本任务:</strong> <ul> <li><a href="cp.php?ac=profile" target="_blank">新窗口打开个人资料设置页面</a>;</li> <li>在新打开的设置页面中,将上述个人资料补充完整。</li> </ul>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/profile.php
PHP
asf20
4,467
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: friend.php 11056 2009-02-09 01:59:47Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if($space['friendnum']>=5) { $task['done'] = 1;//任务完成 } else { //向导 $task['guide'] = ' <strong>请按照以下的说明来参与本任务:</strong> <ul> <li>1. <a href="cp.php?ac=friend&op=find" target="_blank">新窗口打开寻找好友页面</a>;</li> <li>2. 在新打开的页面中,可以将系统自动给你找到的推荐用户加为好友,也可以自己设置条件寻找并添加为好友;</li> <li>3. 接下来,您还需要等待对方批准您的好友申请。</li> </ul>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/friend.php
PHP
asf20
728
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: avatar.php 13217 2009-08-21 06:57:53Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } //判断用户是否设置了头像 include_once(S_ROOT.'./source/function_cp.php'); $avatar_exists = trim(ckavatar($space['uid'])); if(strlen($avatar_exists) < 1) { showmessage('这个功能要求您的UCenter的Server端的 avatar.php 程序需要进行升级。<br>如果您是本站管理员,请通过下面的地址下载 avatar.php 文件的压缩包,并覆盖您的UCenter根目录中的同名文件即可。<br><a href="http://u.discuz.net/download/avatar.zip">http://u.discuz.net/download/avatar.zip</a>'); } if($avatar_exists) { //任务完成 $task['done'] = 1; //更新用户头像标识位 updatetable('space', array('avatar'=>1), array('uid'=>$space['uid'])); //找热门异性有头像的用户 $wherearr = array(); $wherearr[] = "s.uid=sf.uid"; $wherearr[] = "s.avatar='1'"; if($space['sex'] == 2) { $title = '帅哥'; $wherearr[] = "sf.sex='1'"; } else { $title = '美女'; $wherearr[] = "sf.sex='2'"; } $space['friends'][] = $space['uid']; $nouids = implode(',', $space['friends']); $wherearr[] = "s.uid NOT IN ($nouids)"; $query = $_SGLOBAL['db']->query("SELECT s.uid,s.username,s.name,s.namestatus FROM ".tname('space')." s, ".tname('spacefield')." sf WHERE ".implode(' AND ', $wherearr)." ORDER BY s.friendnum DESC LIMIT 0,10"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']); $spaces[] = $value; } realname_get(); if($spaces) { $task['result'] = '<p>找到'.$title.'朋友,推荐给您:</p>'; $task['result'] .= '<ul class="avatar_list">'; foreach ($spaces as $key => $value) { $task['result'] .= '<li> <div class="avatar48"><a href="space.php?uid='.$value['uid'].'" target="_blank">'.avatar($value['uid'], 'small').'</a></div> <p><a href="space.php?uid='.$value['uid'].'" target="_blank" target="_blank">'.$_SN[$value['uid']].'</a></p> <p class=\"time\"><a href="cp.php?ac=friend&op=add&uid='.$value['uid'].'" id="a_reside_friend_'.$key.'" onclick="ajaxmenu(event, this.id, 1)">加为好友</a></p> </li>'; } $task['result'] .= '</ul>'; } } else { //任务完成向导 $task['guide'] = '请按照以下的说明来参与本任务: <ul> <li>1. <a href="cp.php?ac=avatar" target="_blank">新窗口打开个人头像设置页面</a>;</li> <li>2. 在新打开的设置页面中,请选择您的照片进行上传编辑。</li> </ul>'; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/avatar.php
PHP
asf20
2,700
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: gift.php 12841 2009-07-23 02:01:57Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if($_SGLOBAL['supe_uid']) { $task['done'] = 1;//任务完成 $task['result'] = '<p>给您送上一份 《热门日志导读》 看看吧:</p>'; $task['result'] .= '<br><ul class="line_list">'; $bloglist = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('blog')." WHERE hot>='3' AND friend='0' ORDER BY dateline DESC LIMIT 0,20"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['uid'], $value['username']); $bloglist[] = $value; } realname_get(); foreach ($bloglist as $value) { $task['result'] .= "<li><a href=\"space.php?uid=$value[uid]\" target=\"_blank\"><strong>".$_SN[$value['uid']]."</strong></a>:<a href=\"space.php?uid=$value[uid]&do=blog&id=$value[blogid]\" target=\"_blank\">$value[subject]</a> <span class=\"gray\">($value[hot]人推荐)</span></li>"; } $task['result'] .= '</ul>'; } else { $task['guide'] = ''; } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/task/gift.php
PHP
asf20
1,104
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: class_mysql.php 10484 2008-12-05 05:46:59Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } class dbstuff { var $querynum = 0; var $link; var $charset; function connect($dbhost, $dbuser, $dbpw, $dbname = '', $pconnect = 0, $halt = TRUE) { if($pconnect) { if(!$this->link = @mysql_pconnect($dbhost, $dbuser, $dbpw)) { $halt && $this->halt('Can not connect to MySQL server'); } } else { if(!$this->link = @mysql_connect($dbhost, $dbuser, $dbpw, 1)) { $halt && $this->halt('Can not connect to MySQL server'); } } if($this->version() > '4.1') { if($this->charset) { @mysql_query("SET character_set_connection=$this->charset, character_set_results=$this->charset, character_set_client=binary", $this->link); } if($this->version() > '5.0.1') { @mysql_query("SET sql_mode=''", $this->link); } } if($dbname) { @mysql_select_db($dbname, $this->link); } } function select_db($dbname) { return mysql_select_db($dbname, $this->link); } function fetch_array($query, $result_type = MYSQL_ASSOC) { return mysql_fetch_array($query, $result_type); } function query($sql, $type = '') { if(D_BUG) { global $_SGLOBAL; $sqlstarttime = $sqlendttime = 0; $mtime = explode(' ', microtime()); $sqlstarttime = number_format(($mtime[1] + $mtime[0] - $_SGLOBAL['supe_starttime']), 6) * 1000; } $func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ? 'mysql_unbuffered_query' : 'mysql_query'; if(!($query = $func($sql, $this->link)) && $type != 'SILENT') { $this->halt('MySQL Query Error', $sql); } if(D_BUG) { $mtime = explode(' ', microtime()); $sqlendttime = number_format(($mtime[1] + $mtime[0] - $_SGLOBAL['supe_starttime']), 6) * 1000; $sqltime = round(($sqlendttime - $sqlstarttime), 3); $explain = array(); $info = mysql_info(); if($query && preg_match("/^(select )/i", $sql)) { $explain = mysql_fetch_assoc(mysql_query('EXPLAIN '.$sql, $this->link)); } $_SGLOBAL['debug_query'][] = array('sql'=>$sql, 'time'=>$sqltime, 'info'=>$info, 'explain'=>$explain); } $this->querynum++; return $query; } function affected_rows() { return mysql_affected_rows($this->link); } function error() { return (($this->link) ? mysql_error($this->link) : mysql_error()); } function errno() { return intval(($this->link) ? mysql_errno($this->link) : mysql_errno()); } function result($query, $row) { $query = @mysql_result($query, $row); return $query; } function num_rows($query) { $query = mysql_num_rows($query); return $query; } function num_fields($query) { return mysql_num_fields($query); } function free_result($query) { return mysql_free_result($query); } function insert_id() { return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0); } function fetch_row($query) { $query = mysql_fetch_row($query); return $query; } function fetch_fields($query) { return mysql_fetch_field($query); } function version() { return mysql_get_server_info($this->link); } function close() { return mysql_close($this->link); } function halt($message = '', $sql = '') { $dberror = $this->error(); $dberrno = $this->errno(); $help_link = "http://faq.comsenz.com/?type=mysql&dberrno=".rawurlencode($dberrno)."&dberror=".rawurlencode($dberror); echo "<div style=\"position:absolute;font-size:11px;font-family:verdana,arial;background:#EBEBEB;padding:0.5em;\"> <b>MySQL Error</b><br> <b>Message</b>: $message<br> <b>SQL</b>: $sql<br> <b>Error</b>: $dberror<br> <b>Errno.</b>: $dberrno<br> <a href=\"$help_link\" target=\"_blank\">Click here to seek help.</a> </div>"; exit(); } } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/class_mysql.php
PHP
asf20
3,972
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: cp_password.php 12934 2009-07-29 02:35:59Z zhengqingpeng $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if(submitcheck('pwdsubmit')) { if($_POST['newpasswd1'] != $_POST['newpasswd2']) { showmessage('password_inconsistency'); } if($_POST['newpasswd1'] != addslashes($_POST['newpasswd1'])) { showmessage('profile_passwd_illegal'); } @include_once(S_ROOT.'./uc_client/client.php'); $ucresult = uc_user_edit($_SGLOBAL['supe_username'], $_POST['password'], $_POST['newpasswd1'], $space['email']); if($ucresult == -1) { showmessage('old_password_invalid'); } elseif($ucresult == -4) { showmessage('email_format_is_wrong'); } elseif($ucresult == -5) { showmessage('email_not_registered'); } elseif($ucresult == -6) { showmessage('email_has_been_registered'); } elseif($ucresult == -7) { showmessage('no_change'); } elseif($ucresult == -8) { showmessage('protection_of_users'); } clearcookie(); showmessage('getpasswd_succeed', 'do.php?ac='.$_SCONFIG['login_action']); } $actives = array('profile' => ' class="active"'); include_once template("cp_password"); ?>
zyyhong
trunk/jiaju001/newbbs/home/source/cp_password.php
PHP
asf20
1,207
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_common.js 13191 2009-08-18 03:14:55Z xupeng $ */ 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); var is_safari = (userAgent.indexOf('webkit') != -1 || userAgent.indexOf('safari') != -1); var note_step = 0; var note_oldtitle = document.title; var note_timer; //iframe包含 if (top.location != location) { top.location.href = location.href; } function $(id) { return document.getElementById(id); } function addSort(obj) { if (obj.value == 'addoption') { var newOptDiv = document.createElement('div') newOptDiv.id = obj.id+'_menu'; newOptDiv.innerHTML = '<h1>添加</h1><a href="javascript:;" onclick="addOption(\'newsort\', \''+obj.id+'\')" class="float_del">删除</a><div class="popupmenu_inner" style="text-align: center;">名称:<input type="text" name="newsort" size="10" id="newsort" class="t_input" /><input type="button" name="addSubmit" value="创建" onclick="addOption(\'newsort\', \''+obj.id+'\')" class="button" /></div>'; newOptDiv.className = 'popupmenu_centerbox'; newOptDiv.style.cssText = 'position: absolute; left: 50%; top: 200px; width: 400px; margin-left: -200px;'; document.body.appendChild(newOptDiv); $('newsort').focus(); } } 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]); // doesn't work in IE } catch(ex) { obj.add(newOptionTag, obj.selecedIndex); // IE only } obj.value="new:" + newOption; } else { obj.value=obj.options[0].value; } // Remove newOptDiv var newOptDiv = document.getElementById(aid+'_menu'); var parent = newOptDiv.parentNode; var removedChild = parent.removeChild(newOptDiv); } 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) { return is_ie && document.charset == 'utf-8' ? encodeURIComponent(str) : str; } 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 strlen(str) { return (is_ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length; } function getExt(path) { return path.lastIndexOf('.') == -1 ? '' : path.substr(path.lastIndexOf('.') + 1, path.length).toLowerCase(); } function doane(event) { e = event ? event : window.event; if(is_ie) { e.returnValue = false; e.cancelBubble = true; } else if(e) { e.stopPropagation(); e.preventDefault(); } } //验证码 function seccode() { var img = 'do.php?ac=seccode&rand='+Math.random(); document.writeln('<img id="img_seccode" src="'+img+'" align="absmiddle">'); } function updateseccode() { var img = 'do.php?ac=seccode&rand='+Math.random(); if($('img_seccode')) { $('img_seccode').src = img; } } //缩小图片并添加链接 function resizeImg(id,size) { var theImages = $(id).getElementsByTagName('img'); for (i=0; i<theImages.length; i++) { theImages[i].onload = function() { if (this.width > 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); } } } } } } //Ctrl+Enter 发布 function ctrlEnter(event, btnId, onlyEnter) { if(isUndefined(onlyEnter)) onlyEnter = 0; if((event.ctrlKey || onlyEnter) && event.keyCode == 13) { $(btnId).click(); return false; } return true; } //缩放Textarea 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; } } //复制URL地址 function setCopy(_sTxt){ if(is_ie) { clipboardData.setData('Text',_sTxt); alert ("网址“"+_sTxt+"”\n已经复制到您的剪贴板中\n您可以使用Ctrl+V快捷键粘贴到需要的地方"); } else { prompt("请复制网站地址:",_sTxt); } } //验证是否有选择记录 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 showPreview(val, id) { var showObj = $(id); if(typeof showObj == 'object') { showObj.innerHTML = val.replace(/\n/ig, "<br />"); } } 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 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 in tags) { 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 in tags) { 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 quick_validate(obj) { if($('seccode')) { var code = $('seccode').value; var x = new Ajax(); x.get('cp.php?ac=common&op=seccode&code=' + code, function(s){ s = trim(s); if(s != 'succeed') { alert(s); $('seccode').focus(); return false; } else { obj.form.submit(); return true; } }); } else { obj.form.submit(); return true; } } function trim(str) { var re = /\s*(\S[^\0]*\S)\s*/; re.exec(str); return RegExp.$1; } // 停止音乐flash function stopMusic(preID, playerID) { var musicFlash = preID.toString() + '_' + playerID.toString(); if($(musicFlash)) { $(musicFlash).SetVariable('closePlayer', 1); } } // 显示影视、音乐flash function showFlash(host, flashvar, obj, shareid) { var flashAddr = { 'youku.com' : 'http://player.youku.com/player.php/sid/FLASHVAR=/v.swf', 'ku6.com' : 'http://player.ku6.com/refer/FLASHVAR/v.swf', 'youtube.com' : 'http://www.youtube.com/v/FLASHVAR', '5show.com' : 'http://www.5show.com/swf/5show_player.swf?flv_id=FLASHVAR', 'sina.com.cn' : 'http://vhead.blog.sina.com.cn/player/outer_player.swf?vid=FLASHVAR', 'sohu.com' : 'http://v.blog.sohu.com/fo/v4/FLASHVAR', 'mofile.com' : 'http://tv.mofile.com/cn/xplayer.swf?v=FLASHVAR', 'music' : 'FLASHVAR', 'flash' : 'FLASHVAR' }; var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="480" height="400">' + '<param name="movie" value="FLASHADDR" />' + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#FFFFFF" />' + '<embed width="480" height="400" menu="false" quality="high" src="FLASHADDR" type="application/x-shockwave-flash" />' + '</object>'; var videoFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="450">' + '<param value="transparent" name="wmode"/>' + '<param value="FLASHADDR" name="movie" />' + '<embed src="FLASHADDR" wmode="transparent" allowfullscreen="true" type="application/x-shockwave-flash" width="480" height="450"></embed>' + '</object>'; var musicFlash = '<object id="audioplayer_SHAREID" height="24" width="290" data="image/player.swf" type="application/x-shockwave-flash">' + '<param value="image/player.swf" name="movie"/>' + '<param value="autostart=yes&bg=0xCDDFF3&leftbg=0x357DCE&lefticon=0xF2F2F2&rightbg=0xF06A51&rightbghover=0xAF2910&righticon=0xF2F2F2&righticonhover=0xFFFFFF&text=0x357DCE&slider=0x357DCE&track=0xFFFFFF&border=0xFFFFFF&loader=0xAF2910&soundFile=FLASHADDR" name="FlashVars"/>' + '<param value="high" name="quality"/>' + '<param value="false" name="menu"/>' + '<param value="#FFFFFF" name="bgcolor"/>' + '</object>'; var musicMedia = '<object height="64" width="290" data="FLASHADDR" type="audio/x-ms-wma">' + '<param value="FLASHADDR" name="src"/>' + '<param value="1" name="autostart"/>' + '<param value="true" name="controller"/>' + '</object>'; var flashHtml = videoFlash; var videoMp3 = true; if('' == flashvar) { alert('音乐地址错误,不能为空'); return false; } if('music' == host) { var mp3Reg = new RegExp('.mp3$', 'ig'); var flashReg = new RegExp('.swf$', 'ig'); flashHtml = musicMedia; videoMp3 = false if(mp3Reg.test(flashvar)) { videoMp3 = true; flashHtml = musicFlash; } else if(flashReg.test(flashvar)) { videoMp3 = true; flashHtml = flash; } } flashvar = encodeURI(flashvar); if(flashAddr[host]) { var flash = flashAddr[host].replace('FLASHVAR', flashvar); flashHtml = flashHtml.replace(/FLASHADDR/g, flash); flashHtml = flashHtml.replace(/SHAREID/g, shareid); } if(!obj) { $('flash_div_' + shareid).innerHTML = flashHtml; return true; } if($('flash_div_' + shareid)) { $('flash_div_' + shareid).style.display = ''; $('flash_hide_' + shareid).style.display = ''; obj.style.display = 'none'; return true; } if(flashAddr[host]) { var flashObj = document.createElement('div'); flashObj.id = 'flash_div_' + shareid; obj.parentNode.insertBefore(flashObj, obj); flashObj.innerHTML = flashHtml; obj.style.display = 'none'; var hideObj = document.createElement('div'); hideObj.id = 'flash_hide_' + shareid; var nodetxt = document.createTextNode("收起"); hideObj.appendChild(nodetxt); obj.parentNode.insertBefore(hideObj, obj); hideObj.style.cursor = 'pointer'; hideObj.onclick = function() { if(true == videoMp3) { stopMusic('audioplayer', shareid); flashObj.parentNode.removeChild(flashObj); hideObj.parentNode.removeChild(hideObj); } else { flashObj.style.display = 'none'; hideObj.style.display = 'none'; } obj.style.display = ''; } } } //显示全部应用 function userapp_open() { var x = new Ajax(); x.get('cp.php?ac=common&op=getuserapp', function(s){ $('my_userapp').innerHTML = s; $('a_app_more').className = 'on'; $('a_app_more').innerHTML = '收起'; $('a_app_more').onclick = function() { userapp_close(); } }); } //关闭全部应用 function userapp_close() { var x = new Ajax(); x.get('cp.php?ac=common&op=getuserapp&subop=off', function(s){ $('my_userapp').innerHTML = s; $('a_app_more').className = 'off'; $('a_app_more').innerHTML = '展开'; $('a_app_more').onclick = function() { userapp_open(); } }); } //滚动 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('do.php?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 display(id) { var obj = $(id); obj.style.display = obj.style.display == '' ? 'none' : ''; } function urlto(url) { window.location.href = url; } function explode(sep, string) { return string.split(sep); } function selector(pattern, context) { var re = new RegExp('([a-z]*)([\.#:]*)(.*|$)', 'ig'); var match = re.exec(pattern); var conditions = []; 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<s.length; i++) { var cc = null; if (cc = /([\w]+)([=^%!$~]+)(.*)$/.exec(s[i])){ conditions.push([cc[1], cc[2], cc[3]]); } } var list = (context || document).getElementsByTagName(match[1] || "*"); if(conditions) { var elements = []; var attrMapping = {'for': 'htmlFor', 'class': 'className'}; for(var i=0; i<list.length; i++) { var pass = true; for(var j=0; j<conditions.length; j++) { var attr = attrMapping[conditions[j][0]] || conditions[j][0]; var val = list[i][attr] || (list[i].getAttribute ? list[i].getAttribute(attr) : ''); var pattern = null; if(conditions[j][1] == '=') { pattern = new RegExp('^'+conditions[j][2]+'$', 'i'); } else if(conditions[j][1] == '^=') { pattern = new RegExp('^' + conditions[j][2], 'i'); } else if(conditions[j][1] == '$=') { pattern = new RegExp(conditions[j][2] + '$', 'i'); } else if(conditions[j][1] == '%=') { pattern = new RegExp(conditions[j][2], 'i'); } else if(conditions[j][1] == '~=') { pattern = new RegExp('(^|[ ])' + conditions[j][2] + '([ ]|$)', 'i'); } if(pattern && !pattern.test(val)) { pass = false; break; } } if(pass) elements.push(list[i]); } return elements; } else { return list; } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_common.js
JavaScript
asf20
18,901
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: do_inputpwd.php 10298 2008-11-28 07:57:44Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } if(submitcheck('pwdsubmit')) { $blogid = empty($_POST['blogid'])?0:intval($_POST['blogid']); $albumid = empty($_POST['albumid'])?0:intval($_POST['albumid']); $itemarr = array(); if($blogid) { $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('blog')." WHERE blogid='$blogid'"); $itemarr = $_SGLOBAL['db']->fetch_array($query); $itemurl = "space.php?uid=$itemarr[uid]&do=blog&id=$itemarr[blogid]"; $cookiename = 'view_pwd_blog_'.$blogid; } elseif($albumid) { $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('album')." WHERE albumid='$albumid'"); $itemarr = $_SGLOBAL['db']->fetch_array($query); $itemurl = "space.php?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']) { ssetcookie($cookiename, md5(md5($itemarr['password']))); showmessage('proved_to_be_successful', $itemurl); } else { showmessage('password_is_not_passed', $itemurl); } } ?>
zyyhong
trunk/jiaju001/newbbs/home/source/do_inputpwd.php
PHP
asf20
1,238
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: script_manage.js 11845 2009-03-26 08:00:50Z liguode $ */ function validate_ajax(obj) { var subject = $('subject'); if (subject) { var slen = strlen(subject.value); if (slen < 1 || slen > 80) { alert("标题长度(1~80字符)不符合要求"); subject.focus(); return false; } } if($('seccode')) { var code = $('seccode').value; var x = new Ajax(); x.get('cp.php?ac=common&op=seccode&code=' + code, function(s){ s = trim(s); if(s.indexOf('succeed') == -1) { alert(s); $('seccode').focus(); return false; } else { edit_save(); obj.form.submit(); return true; } }); } else { edit_save(); obj.form.submit(); return true; } } function validate(obj) { var subject = $('subject'); if (subject) { var slen = strlen(subject.value); if (slen < 1 || slen > 80) { alert("标题长度(1~80字符)不符合要求"); subject.focus(); return false; } } var makefeed = $('makefeed'); if(makefeed) { if(makefeed.checked == false) { if(!confirm("友情提醒:您确定此次发布不产生动态吗?\n有了动态,好友才能及时看到你的更新。")) { return false; } } } if($('seccode')) { var code = $('seccode').value; var x = new Ajax(); x.get('cp.php?ac=common&op=seccode&code=' + code, function(s){ s = trim(s); if(s.indexOf('succeed') == -1) { alert(s); $('seccode').focus(); return false; } else { uploadEdit(obj); return true; } }); } else { uploadEdit(obj); return true; } } function edit_album_show(id) { var obj = $('uchome-edit-'+id); if(id == 'album') { $('uchome-edit-pic').style.display = 'none'; } if(id == 'pic') { $('uchome-edit-album').style.display = 'none'; } if(obj.style.display == '') { obj.style.display = 'none'; } else { obj.style.display = ''; } }
zyyhong
trunk/jiaju001/newbbs/home/source/script_blog.js
JavaScript
asf20
2,175
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: lang_source.php 12489 2009-07-01 06:41:34Z xupeng $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $_SGLOBAL['sourcelang'] = array ( 'hour' => '小时', 'before' => '前', 'minute' => '分钟', 'second' => '秒', 'now' => '现在', 'dot' => '、', 'mtag' => '群组', 'poll' => '投票', 'event' => '活动', 'thread' => '话题', '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' => '自定义', 'default_albumname' => '默认相册', 'wall' => '留言', 'pic_comment' => '图片评论', 'blog_comment' => '日志评论', 'clickblog' => '日志表态', 'clickpic' => '图片表态', 'clickthread' => '话题表态', 'share_comment' => '分享评论', 'share_notice' => '分享', 'doing_comment' => '记录回复', 'friend_notice' => '好友', 'thread_comment' => '话题回复', 'event_comment' => '活动留言', 'event_member' => '活动成员管理', 'event_memberstatus' => '活动成员身份', 'poll_comment' => '投票评论', 'poll_invite' => '投票邀请', 'credit' => '积分', 'credit_unit' => '个', 'man' => '男', 'woman' => '女', 'year' => '年', 'month' => '月', 'day' => '日', 'unmarried' => '单身', 'married' => '非单身', 'hidden_username' => '匿名' ); ?>
zyyhong
trunk/jiaju001/newbbs/home/language/lang_source.php
PHP
asf20
1,635
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: lang_cp.php 13194 2009-08-18 07:44:40Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $_SGLOBAL['cplang'] = array( 'by' => '通过', 'tab_space' => ' ', '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} 发表了评论', 'share' => '分享', 'share_action' => '分享了', 'note_wall' => '在留言板上给你<a href="\\1" target="_blank">留言</a>', 'note_wall_reply' => '回复了你的<a href="\\1" target="_blank">留言</a>', 'note_pic_comment' => '评论了你的<a href="\\1" target="_blank">图片</a>', 'note_pic_comment_reply' => '回复了你的<a href="\\1" target="_blank">图片评论</a>', 'note_blog_comment' => '评论了你的日志 <a href="\\1" target="_blank">\\2</a>', 'note_blog_comment_reply' => '回复了你的<a href="\\1" target="_blank">日志评论</a>', 'note_poll_comment' => '评论了你的投票 <a href="\\1" target="_blank">\\2</a>', 'note_poll_comment_reply' => '回复了你的<a href="\\1" target="_blank">投票评论</a>', 'note_share_comment' => '评论了你的 <a href="\\1" target="_blank">分享</a>', 'note_share_comment_reply' => '回复了你的<a href="\\1" target="_blank">分享评论</a>', 'note_event_comment' => '在你组织的活动里<a href="\\1" target="_blank">留言</a>了', 'note_event_comment_reply' => '回复了你在活动中的<a href="\\1" target="_blank">留言</a>', 'note_show_out' => '访问了你的主页后,你在竞价排名榜中最后一个积分也被消费掉了', 'note_space_bar' => '把你设置为站点推荐用户了', 'note_click_blog' => '对你的日志 <a href="\\1" target="_blank">\\2</a> 做了表态', 'note_click_thread' => '对你的话题 <a href="\\1" target="_blank">\\2</a> 做了表态', 'note_click_pic' => '对你的 <a href="\\1" target="_blank">图片</a> 做了表态', 'wall_pm_subject' => '您好,我给您留言了', 'wall_pm_message' => '我在您的留言板给你留言了,[url=\\1]点击这里去留言板看看吧[/url]', 'note_showcredit' => '赠送给您 \\1 个竞价积分,帮助提升在<a href="space.php?do=top" target="_blank">竞价排行榜</a>中的名次', 'feed_showcredit' => '{actor} 赠送给 {fusername} 竞价积分 {credit} 个,帮助好友提升在<a href="space.php?do=top" target="_blank">竞价排行榜</a>中的名次', 'feed_showcredit_self' => '{actor} 增加竞价积分 {credit} 个,提升自己在<a href="space.php?do=top" target="_blank">竞价排行榜</a>中的名次', 'feed_doing_title' => '{actor}:{message}', 'note_doing_reply' => '在<a href="\\1" target="_blank">记录</a>中对你进行了回复', 'feed_friend_title' => '{actor} 和 {touser} 成为了好友', 'note_friend_add' => '和你成为了好友', 'note_poll_invite' => '邀请你一起参与 <a href="\\1" target="_blank">《\\2》</a>的\\3投票', 'reward' => '悬赏', 'reward_info' => '参与投票可获得 \\1 积分', 'poll_separator' => '"、"', 'feed_upload_pic' => '{actor} 上传了新图片', 'feed_click_blog' => '{actor} 送了一个“{click}”给 {touser} 的日志 {subject}', 'feed_click_thread' => '{actor} 送了一个“{click}”给 {touser} 的话题 {subject}', 'feed_click_pic' => '{actor} 送了一个“{click}”给 {touser} 的图片', 'friend_subject' => '<a href="\\2" target="_blank">\\1 请求加你为好友</a>', 'comment_friend' =>'<a href="\\2" target="_blank">\\1 给你留言了</a>', 'photo_comment' => '<a href="\\2" target="_blank">\\1 评论了你的照片</a>', 'blog_comment' => '<a href="\\2" target="_blank">\\1 评论了你的日志</a>', 'poll_comment' => '<a href="\\2" target="_blank">\\1 评论了你的投票</a>', 'share_comment' => '<a href="\\2" target="_blank">\\1 评论了你的分享</a>', 'friend_pm' => '<a href="\\2" target="_blank">\\1 给你发私信了</a>', 'poke_subject' => '<a href="\\2" target="_blank">\\1 向你打招呼</a>', 'mtag_reply' => '<a href="\\2" target="_blank">\\1 回复了你的话题</a>', 'event_comment' => '<a href="\\2" target="_blank">\\1 评论了你的活动</a>', '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 回复了你的活动评论', 'invite_subject' => '\\1邀请您加入\\2,并成为TA的好友', 'invite_massage' => '<table border="0"> <tr> <td valign="top">\\1</td> <td valign="top"> <h3>Hi,我是\\2,在\\3上建立了个人主页,邀请您也加入并成为我的好友</h3><br> 请加入到我的好友中,你就可以通过我的个人主页了解我的近况,分享我的照片,随时与我保持联系<br> <br> 邀请附言:<br> \\4 <br><br> <strong>请你点击以下链接,接受好友邀请:</strong><br> <a href="\\5">\\5</a><br> <br> <strong>如果你拥有\\3上面的账号,请点击以下链接查看我的个人主页:</strong><br> <a href="\\6">\\6</a><br> </td></tr></table>', 'app_invite_subject' => '\\1邀请您加入\\2,一起来玩\\3', 'app_invite_massage' => '<table border="0"> <tr> <td valign="top">\\1</td> <td valign="top"> <h3>Hi,我是\\2,在\\3上玩 \\7,邀请您也加入一起玩</h3><br> <br> 邀请附言:<br> \\4 <br><br> <strong>请你点击以下链接,接受好友邀请一起玩\\7:</strong><br> <a href="\\5">\\5</a><br> <br> <strong>如果你拥有\\3上面的账号,请点击以下链接查看我的个人主页:</strong><br> <a href="\\6">\\6</a><br> </td></tr></table>', 'feed_mtag_add' => '{actor} 创建了新群组 {mtags}', 'note_members_grade_-9' => '将你从群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 请出', 'note_members_grade_-2' => '将你在群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 的成员身份修改为 待审核', 'note_members_grade_-1' => '将你在群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 中禁言', 'note_members_grade_0' => '将你在群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 的成员身份修改为 普通成员', 'note_members_grade_1' => '将你设为了群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 的明星成员', 'note_members_grade_8' => '将你设为了群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 的副群主', 'note_members_grade_9' => '将你设为了群组 <a href="space.php?do=mtag&tagid=\\1" target="_blank">\\2</a> 的群主', 'feed_mtag_join' => '{actor} 加入了群组 {mtag} ({field})', 'mtag_joinperm_2' => '需邀请才可加入', 'feed_mtag_join_invite' => '{actor} 接受 {fromusername} 的邀请,加入了群组 {mtag} ({field})', 'person' => '人', 'delete' => '删除', 'space_update' => '{actor} 被SHOW了一下', 'active_email_subject' => '您的邮箱激活邮件', 'active_email_msg' => '请复制下面的激活链接到浏览器进行访问,以便激活你的邮箱。<br>邮箱激活链接:<br><a href="\\1" target="_blank">\\1</a>', 'share_space' => '分享了一个用户', 'note_share_space' => '分享了你的空间', 'share_blog' => '分享了一篇日志', 'note_share_blog' => '分享了你的日志 <a href="\\1" target="_blank">\\2</a>', 'share_album' => '分享了一个相册', 'note_share_album' => '分享了你的相册 <a href="\\1" target="_blank">\\2</a>', 'default_albumname' => '默认相册', 'share_image' => '分享了一张图片', 'album' => '相册', 'note_share_pic' => '分享了你的相册 \\2 中的<a href="\\1" target="_blank">图片</a>', 'share_thread' => '分享了一个话题', 'mtag' => '群组', 'note_share_thread' => '分享了你的话题 <a href="\\1" target="_blank">\\2</a>', 'share_mtag' => '分享了一个群组', 'share_mtag_membernum' => '现有 {membernum} 名成员', 'share_tag' => '分享了一个标签', 'share_tag_blognum' => '现有 {blognum} 篇日志', 'share_link' => '分享了一个网址', 'share_video' => '分享了一个视频', 'share_music' => '分享了一个音乐', 'share_flash' => '分享了一个 Flash', 'share_event' => '分享了一个活动', 'share_poll' => '分享了一个\\1投票', 'note_share_poll' => '分享了你的投票 <a href="\\1" target="_blank">\\2</a>', 'event_time' => '活动时间', 'event_location' => '活动地点', 'event_creator' => '发起人', 'feed_task' => '{actor} 完成了有奖任务 {task}', 'feed_task_credit' => '{actor} 完成了有奖任务 {task},领取了 {credit} 个奖励积分', 'the_default_style' => '默认风格', 'the_diy_style' => '自定义风格', 'feed_thread' => '{actor} 发起了新话题', 'feed_eventthread' => '{actor} 发起了新活动话题', 'feed_thread_reply' => '{actor} 回复了 {touser} 的话题 {thread}', 'note_thread_reply' => '回复了你的话题', 'note_post_reply' => '在话题 <a href=\\"\\1\\" target="_blank">\\2</a> 中回复了你的<a href=\\"\\3\\" target="_blank">回帖</a>', 'thread_edit_trail' => '<ins class="modify">[本话题由 \\1 于 \\2 编辑]</ins>', 'create_a_new_album' => '创建了新相册', 'not_allow_upload' => '您现在没有权限上传图片', 'get_passwd_subject' => '取回密码邮件', 'get_passwd_message' => '您只需在提交请求后的三天之内,通过点击下面的链接重置您的密码:<br />\\1<br />(如果上面不是链接形式,请将地址手工粘贴到浏览器地址栏再访问)<br />上面的页面打开后,输入新的密码后提交,之后您即可使用新的密码登录了。', 'file_is_too_big' => '文件过大', 'feed_blog_password' => '{actor} 发表了新加密日志 {subject}', 'feed_blog' => '{actor} 发表了新日志', 'feed_poll' => '{actor} 发起了新投票', 'note_poll_finish' => '您发起的<a href="\\1" target="_blank">《\\2》</a>的投票已结束,<a href="\\1" target="_blank">去写写投票总结</a>', 'take_part_in_the_voting' => '{actor} 参与了 {touser} 的{reward}投票 <a href="{url}" target="_blank">{subject}</a>', '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 张图片', 'feed_invite' => '{actor} 发起邀请,和 {username} 成为了好友', 'note_invite' => '接受了您的好友邀请', 'space_open_subject' => '快来打理一下您的个人主页吧', 'space_open_message' => 'hi,我今天去拜访了一下您的个人主页,发现您自己还没有打理过呢。赶快来看看吧。地址是:\\1space.php', 'feed_space_open' => '{actor} 开通了自己的个人主页', '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} 更新了自己的兴趣爱好等个人信息', 'apply_mtag_manager' => '想申请成为 <a href="\\1" target="_blank">\\2</a> 的群主,理由如下:\\3。<a href="\\1" target="_blank">(点击这里进入管理)</a>', 'feed_add_attachsize' => '{actor} 用 {credit} 个积分兑换了 {size} 附件空间,可以上传更多的图片啦(<a href="cp.php?ac=credit&op=addsize">我也来兑换</a>)', 'event'=>'活动', 'event_set_delete' => '管理员取消了您组织的活动 \\1', 'event_set_verify' => '管理员审核通过了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_set_unverify' => '管理员审核没有通过您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_set_recommend' => '管理员推荐了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_set_unrecommend' => '管理员取消推荐了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_set_open' => '管理员开启了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_set_close' => '管理员关闭了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_add' => '{actor} 发起了新活动', 'event_feed_info' => '<strong>{title}</strong><br/>地点:{province} {city} {location} <br/>时间:{starttime} - {endtime}', 'event_join' => '{actor} 参加了 <a href="space.php?uid={uid}" target="_blank">{username}</a> 的活动 <a href="space.php?do=event&id={eventid}" target="_blank">{title}</a>', 'event_join_member' => '参加了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_quit_member' => '退出了您组织的活动 <a href="\\1" target="_blank">\\2</a>', 'event_join_verify' => '申请参加您组织的活动 <a href="\\1" target="_blank">\\2</a>,赶紧去<a href="\\3" target="_blank">审核</a>吧', 'eventmember_set_verify' => '通过了您参加活动 <a href="\\1" target="_blank">\\2</a> 的申请', 'eventmember_unset_verify' => '把您在活动 <a href="\\1" target="_blank">\\2</a> 中的身份设为了待审核', 'eventmember_set_admin' => '把您设为了活动 <a href="\\1" target="_blank">\\2</a> 的组织者', 'eventmember_unset_admin' => '取消了您作为活动 <a href="\\1" target="_blank">\\2</a> 的组织者身份', 'eventmember_set_delete' => '把您请出了活动 <a href="\\1" target="_blank">\\2</a>', 'event_feed_share_pic_title'=>'{actor} 共享了新照片到活动相册', 'event_feed_share_pic_info'=>'<b><a href="space.php?do=event&id={eventid}&view=pic" target="_blank">{title}</a></b><br/>共 {picnum} 张照片', 'event_accept_invite' => '接受您的邀请参加了活动 <a href="\\1" target="_blank">\\2</a> ', 'event_accept_success' => '成功参加该活动,您可以:<a href="\\1" target="_blank">立即访问该活动</a>', //道具:source/magic/* 'magicunit' => '个', 'magic_note_wall' => '在留言板上给你<a href="\\1" target="_blank">留言</a>', 'magic_call' => '在\\1中点了你的名,<a href="\\2" target="_blank">快去看看吧</a>', 'magicuse_thunder_announce_title' => '<strong>{username} 发出了“雷鸣之声”</strong>', 'magicuse_thunder_announce_body' => '大家好,我上线啦<br><a href="space.php?uid={uid}" target="_blank">欢迎来我家串个门</a>', 'magic_present_note' => '送给你一个道具 \\1, <a href="\\2">赶快去看看吧</a>', //用户组升级获赠道具 'upgrade_magic_award' => '恭喜你等级提升为 \\1,并获赠以下道具:\\2', //管理员向用户赠送道具 'present_user_magics' => '您收到了管理员赠送的道具:\\1', 'has_not_more_doodle' => '您没有涂鸦板了', 'do_stat_login' => '来访用户', 'do_stat_register' => '新注册用户', 'do_stat_invite' => '好友邀请', 'do_stat_appinvite' => '应用邀请', 'do_stat_add' => '信息发布', 'do_stat_comment' => '信息互动', 'do_stat_space' => '用户互动', 'do_stat_login' => '来访用户', 'do_stat_doing' => '记录', 'do_stat_blog' => '日志', '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' => '打招呼' ); ?>
zyyhong
trunk/jiaju001/newbbs/home/language/lang_cp.php
PHP
asf20
17,004
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: lang_cpmessage.php 12878 2009-07-24 05:59:38Z xupeng $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $_SGLOBAL['cplang'] = array( //common 'do_success' => '进行的操作完成了', //admincp.php 'enter_the_password_is_incorrect' => '输入的密码不正确,请重新尝试', 'excessive_number_of_attempts_to_sign' => '您30分钟内尝试登录管理平台的次数超过了3次,为了数据安全,请稍候再试', //admincp.php //admin/admincp_ad.php 'no_authority_management_operation' => '对不起,您没有权限进行本管理操作', 'please_check_whether_the_option_complete_required' => '请检查必填选项是否填写完整', 'please_choose_to_remove_advertisements' => '请至少选择一个要删除的广告', 'no_authority_management_operation_edittpl' => '安全考虑,在线编辑模板功能默认关闭,并且只有创始人可以操作。如果您想使用此功能,请修改config.php中的相关配置。', 'no_authority_management_operation_backup' => '安全考虑,数据库备份恢复操作只有创始人可以操作。如果您想使用此功能,请修改config.php中的相关配置。', //admin/admincp_album.php 'at_least_one_option_to_delete_albums' => '请至少正确选择一个要删除的相册', //admin/admincp_backup.php 'data_import_failed_the_file_does_not_exist' => '数据导入失败,文件不存在', 'start_transferring_data' => '数据导入开始', 'wrong_data_file_format_into_failure' => '数据导入失败,文件格式不对', 'documents_were_incorrect_length' => '文件名长度不正确', 'backup_table_wrong' => '备份表出错', 'failure_writes_the_document_check_file_permissions' => '写入文件失败,请检查文件权限', 'successful_data_compression_and_backup_server_to' => '数据成功备份并压缩至服务器', 'backup_file_compression_failure' => '对不起,备份数据文件压缩失败,请检查目录权限', 'shell_backup_failure' => 'SHELL备份失败', 'data_file_does_not_exist' => '对不起, 数据文件不存在,请检查', 'the_volumes_of_data_into_databases_success' => '分卷数据成功导入UCenter Home数据库.', 'data_file_does_not_exist' => '对不起数据文件不存在请检查', 'data_file_format_is_wrong_not_into' => '数据文件非格式,无法导入。', 'directory_does_not_exist_or_can_not_be_accessed' => '目录不存在或无法访问,请检查 \\1 目录。', 'vol_backup_database' => '分卷备份: 数据文件 # \\1 成功创建,程序将自动继续。', 'complete_database_backup' => '恭喜您,全部 \\1 个备份文件成功创建,备份完成。', 'decompress_data_files_success' => '数据文件 # \\1 成功解压缩,程序将自动继续。', 'data_files_into_success' => '数据文件 # \\1 成功导入,程序将自动继续。', //admin/admincp_block.php 'correctly_completed_module_name' => '请正确填写数据模块的名称', 'a_call_to_delete_the_specified_modules_success' => '指定的数据调用模块删除成功了', 'designated_data_transfer_module_does_not_exist' => '指定的数据调用模块不存在', 'sql_statements_can_not_be_completed_for_normal' => '填写的SQL语句不能正常查询,请返回检查。<br>服务器反馈:<br>ERROR: \\1<br>ERRNO. \\2', 'enter_the_next_step' => '进入下一步操作', 'choose_to_delete_the_data_transfer_module' => '请至少选择一个要删除的数据调用模块', //admin/admincp_blog.php 'the_correct_choice_to_delete_the_log' => '请至少正确选择一个要删除的日志', 'the_correct_choice_to_add_topic' => '推荐到指定热点出错,请确认是否正确操作', 'add_topic_success' => '推荐到热点完成了,产生了 \\1 个相关动态', //admin/admincp_cache.php //admin/admincp_censor.php //admin/admincp_comment.php 'the_correct_choice_to_delete_comments' => '请至少正确选择一个要删除的评论', 'choice_batch_action' => '请选择要进行的操作类型', //admin/admincp_config.php 'ip_is_not_allowed_to_visit_the_area' => '当前的IP( \\1 )不在允许访问的IP范围内,请检查设置', 'the_prohibition_of_the_visit_within_the_framework_of_ip' => '当前的IP( \\1 )在禁止访问的IP范围内,请检查设置', 'config_uc_dir_error' => '设置的UCenter物理路径不正确,请返回检查', //admin/admincp_credit.php 'rules_do_not_exist_points' => '该积分规则不存在', //admin/admincp_cron.php 'designated_script_file_incorrect' => '指定的脚本文件不正确', 'implementation_cycle_incorrect_script' => '设定的脚本执行周期不正确', //admin/admincp_item.php 'choose_to_delete_events' => '请至少正确选择一个要删除的事件', //admin/admincp_mtag.php 'choose_to_delete_the_columns_tag' => '请至少正确选择一个要删除的群组', 'designated_to_merge_the_columns_do_not_exist' => '要合并到的新群组还没有创建,请先自行创建此群组后再进行合并', 'the_successful_merger_of_the_designated_columns' => '合并指定的群组成功了', 'columns_option_to_merge_the_tag' => '请至少正确选择一个要合并的群组', 'lock_open_designated_columns_tag_success' => '锁定/开放指定的群组成功了', 'recommend_designated_columns_tag_success' => '推荐/取消推荐指定的群组成功了', 'choose_to_operate_columns_tag' => '请至少正确选择一个要操作的群组', 'failed_to_change_the_length_of_columns' => '栏目长度变更失败,这可能是现存的数据已经超过新长度', //admin/admincp_pic.php 'choose_to_delete_pictures' => '请至少正确选择一个要删除的图片', //admin/admincp_post.php 'choose_to_delete_the_topic' => '请至少正确选择一个要删除的话题', //admin/admincp_profield.php 'there_is_no_designated_users_columns' => '指定操作的群组栏目不存在', 'choose_to_delete_the_columns' => '请正确选择要删除的栏目', 'have_one_mtag' => '删除失败,请至少要保留一个群组栏目', //admin/admincp_poll.php 'the_correct_choice_to_delete_the_poll' => '请至少正确选择一个要删除的投票', //admin/admincp_report.php 'the_right_to_report_the_specified_id' => '请正确指定举报ID', //admin/admincp_share.php 'please_delete_the_correct_choice_to_share' => '请正确选择要删除的分享', //admin/admincp_space.php 'designated_users_do_not_exist' => '您指定的用户不存在', 'choose_to_delete_the_space' => '请正确选择要删除的空间', 'not_have_permission_to_operate_founder' => '你没有权限对创始人进行操作', 'uc_error' => '与用户中心通信出错,请稍后再试', //admin/admincp_stat.php 'choose_to_reconsider_statistical_data_types' => '请正确选择要重新统计的数据类型', 'data_processing_please_wait_patiently' => '<a href="\\1">处理数据中( \\2 ),请耐心等候...</a> (<a href="\\3">强制终止</a>)', //admin/admincp_tag.php 'choose_to_delete_the_tag' => '请至少正确选择一个要删除的标签', 'to_merge_the_tag_name_of_the_length_discrepancies' => '指定的要合并到的tag名称字符长度不符合要求(1~30个字符)', 'the_tag_choose_to_merge' => '请至少正确选择一个要合并的标签', 'choose_to_operate_tag' => '请至少正确选择一个要操作的标签', //admin/admincp_template.php 'designated_template_files_can_not_be_restored' => '指定的模板文件不能恢复', 'template_files_editing_failure_check_directory_competence' => '指定的模板文件无法编辑,请检查 ./template 目录权限设置', //admin/admincp_thread.php 'choosing_to_operate_the_topic' => '请正确选择要操作的话题', //admin/admincp_usergroup.php 'user_group_does_not_exist' => '指定操作的用户组不存在', 'user_group_were_not_empty' => '指定的用户组名不能为空', 'integral_limit_duplication_with_other_user_group' => '指定的积分下限跟其他用户组重复', 'system_user_group_could_not_be_deleted' => '系统用户组不能删除', 'integral_limit_error' => '指定的积分下限上能超过999999999,下限不能低于-999999998', //admin/admincp_userapp.php 'my_register_sucess' => '成功开启用户应用服务', 'my_register_error' => '开启用户应用服务失败,失败原因:<br>\\2 (ERRCODE:\\1)<br><br><a href="http://www.discuz.net/index.php?gid=141" target="_blank">如果有疑问,请访问我们的技术论坛寻求帮助</a>。', 'sitefeed_error' => '请正确添加动态标题、动态内容再提交发布', //admin/admincp_event.php 'choose_to_delete_the_columns_event'=>'请选择要删除的活动', 'choose_to_grade_the_columns_event'=>'请选择要设置的活动状态,新状态不能和原状态相同', 'have_no_eventclass'=>'删除失败,请保留至少一个活动分类', 'poster_only_jpg_allowed'=>'由于您的服务器不支持生成缩略图,您在此处只能上传 jpg 格式的图片' ); ?>
zyyhong
trunk/jiaju001/newbbs/home/language/lang_cpmessage.php
PHP
asf20
9,220
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: lang_exif.php 6565 2008-03-14 09:26:09Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $_SGLOBAL['exiflang'] = array( 'unknown' => '未知', '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格式' ); ?>
zyyhong
trunk/jiaju001/newbbs/home/language/lang_exif.php
PHP
asf20
3,009
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: lang_showmessage.php 13183 2009-08-17 04:35:11Z xupeng $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } $_SGLOBAL['msglang'] = array( 'box_title' => '消息', //common 'do_success' => '进行的操作完成了', 'no_privilege' => '您目前没有权限进行此操作', 'no_privilege_realname' => '您需要填写真实姓名后才能进行当前操作,<a href="cp.php?ac=profile">点这里设置真实姓名</a>', 'no_privilege_videophoto' => '您需要视频认证通过后才能进行当前操作,<a href="cp.php?ac=videophoto">点这里进行视频认证</a>', 'no_open_videophoto' => '目前站点已经关闭视频认证功能', 'is_blacklist' => '受对方的隐私设置影响,您目前没有权限进行本操作', 'no_privilege_newusertime' => '您目前处于见习期间,需要等待 \\1 小时后才能进行本操作', 'no_privilege_avatar' => '您需要设置自己的头像后才能进行本操作,<a href="cp.php?ac=avatar">点这里设置</a>', 'no_privilege_friendnum' => '您需要添加 \\1 个好友之后,才能进行本操作,<a href="cp.php?ac=friend&op=find">点这里添加好友</a>', 'no_privilege_email' => '您需要验证激活自己的邮箱后才能进行本操作,<a href="cp.php?ac=profile&op=contact">点这里激活邮箱</a>', 'uniqueemail_check' => '您填入的邮箱地址已经被占用,请尝试使用其他邮箱', 'uniqueemail_recheck' => '您要验证的邮箱地址已经激活过了,请进入个人资料重新设置自己的邮箱', 'you_do_not_have_permission_to_visit' => '您已被禁止访问。', //mt.php 'designated_election_it_does_not_exist' => '指定的群组不存在,您可以尝试创建', 'mtag_tagname_error' => '设置的群组名称不符合要求', 'mtag_join_error' => '加入指定的群组失败,请尝试搜索现有的相关群组,并在相应的群组中申请成为会员', 'mtag_join_field_error' => '群组分类 \\1 下面最多只允许加入 \\2 个群组,您已经到达上限', 'mtag_creat_error' => '您要查看的群组目前还没有被创建', //index.php 'enter_the_space' => '进入个人空间页面', //network.php 'points_deducted_yes_or_no' => '本次操作将扣减您 \\1 个积分,\\2 个经验值,确认继续?<br><br><a href="\\3" class="submit">继续操作</a> &nbsp; <a href="javascript:history.go(-1);" class="button">取消</a>', 'points_search_error' => "您现在的积分或经验值不足,无法完成本次搜索", //source/cp_album.php 'photos_do_not_support_the_default_settings' => '默认相册不支持本设置', 'album_name_errors' => '您没有正确设置相册名', //source/space_app.php 'correct_choice_for_application_show' => '请选择正确的应用进行查看', //source/do_login.php 'users_were_not_empty_please_re_login' => '对不起,用户名不能为空,请重新登录', 'login_failure_please_re_login' => '对不起,登录失败,请重新登录', //source/cp_blog.php 'no_authority_expiration_date' => '您当前权限已被管理员暂时限制,恢复的时间为:\\1', 'no_authority_expiration' => '您当前权限已被管理员限制,请理解我们的管理', 'no_authority_to_add_log' => '您目前没有权限添加日志', 'no_authority_operation_of_the_log' => '您没有权限操作该日志', 'that_should_at_least_write_things' => '至少应该写一点东西', 'failed_to_delete_operation' => '删除失败,请检查操作', 'click_error' => '没有进行正常的表态操作', 'click_item_error' => '要表态的对象不存在', 'click_no_self' => '自己不能给自己表态', 'click_have' => '您已经表过态了', 'click_success' => '参与表态完成了', //source/cp_class.php 'did_not_specify_the_type_of_operation' => '没有正确指定要操作的分类', 'enter_the_correct_class_name' => '请正确输入分类名', 'note_wall_reply_success' => '已经回复到 \\1 的留言板', //source/cp_comment.php 'operating_too_fast' => "两次发布操作太快了,请等 \\1 秒钟再试", 'content_is_too_short' => '输入的内容不能少于2个字符', 'comments_do_not_exist' => '指定的评论不存在', 'do_not_accept_comments' => '该日志不接受评论', 'sharing_does_not_exist' => '评论的分享不存在', 'non_normal_operation' => '非正常操作', 'the_vote_only_allows_friends_to_comment' => '该投票只允许好友评论', //source/cp_common.php 'security_exit' => '你已经安全退出了\\1', //source/cp_doing.php 'should_write_that' => '至少应该写一点东西', 'docomment_error' => '请正确指定要评论的记录', //source/cp_invite.php 'mail_can_not_be_empty' => '邮件列表不能为空', 'send_result_1' => '邮件已经送出,您的好友可能需要几分钟后才能收到邮件', 'send_result_2' => '<strong>以下邮件发送失败:</strong><br/>\\1', 'send_result_3' => '未找到相应的邀请记录, 邮件重发失败.', 'there_is_no_record_of_invitation_specified' => '您指定的邀请记录不存在', //source/cp_import.php 'blog_import_no_result' => '"无法获取原数据,请确认已正确输入的站点URL和帐号信息,服务器返回:<br /><textarea name=\"tmp[]\" style=\"width:98%;\" rows=\"4\">\\1</textarea>"', 'blog_import_no_data' => '获取数据失败,请参考服务器返回:<br />\\1', 'support_function_has_not_yet_opened fsockopen' => '站点尚未开启fsockopen函数支持,还不能使用本功能', 'integral_inadequate' => "您现在的积分 \\1 不足以完成本次操作。本操作将需要积分: \\2", 'experience_inadequate' => "您现在的经验值\\1 不足以完成本次操作。本操作将需要经验值: \\2", 'url_is_not_correct' => '输入的网站URL不正确', 'choose_at_least_one_log' => '请至少选择一个要导入的日志', //source/cp_friend.php 'friends_add' => '您和 \\1 成为好友了', 'you_have_friends' => '你们已经是好友了', 'enough_of_the_number_of_friends' => '您当前的好友数目达到系统限制,请先删除部分好友', 'enough_of_the_number_of_friends_with_magic' => '您当前的好友数目达到系统限制,<a id="a_magic_friendnum2" href="magic.php?mid=friendnum" onclick="ajaxmenu(event, this.id, 1)">使用好友增容卡增容</a>', 'request_has_been_sent' => '好友请求已经发送,请等待对方验证中', 'waiting_for_the_other_test' => '正在等待对方验证中', 'please_correct_choice_groups_friend' => '请正确选择分组好友', 'specified_user_is_not_your_friend' => '指定的用户还不是您的好友', //source/cp_mtag.php 'mtag_managemember_no_privilege' => '您不能对当前选定的成员进行群组权限变更操作,请重新选择', 'mtag_max_inputnum' => '无法加入,您在栏目 "\\1" 中的群组数目已达到 \\2 个限制数目', 'you_are_already_a_member' => '您已经是该群组的成员了', 'join_success' => '加入成功,您现在是该群组的成员了', 'the_discussion_topic_does_not_exist' => '对不起,参与讨论的话题不存在', 'content_is_not_less_than_four_characters' => '对不起,内容不能少于2个字符', 'you_are_not_a_member_of' => '您不是该群组的成员', 'unable_to_manage_self' => '您不能对自己进行操作', 'mtag_joinperm_1' => '您已经选择加入该群组,请等待群主审核您的加入申请', 'mtag_joinperm_2' => '本群组需要收到群主邀请后才能加入', 'invite_mtag_ok' => '成功加入该群组,您可以:<a href="space.php?do=mtag&tagid=\\1" target="_blank">立即访问该群组</a>', 'invite_mtag_cancel' => '忽略该群组邀请完成', 'failure_to_withdraw_from_group' => '退出私密群组失败,请先指定一个主群主', 'fill_out_the_grounds_for_the_application' => '请填写群主申请理由', //source/cp_pm.php 'this_message_could_not_be_deleted' => '指定的短消息不能被删除', 'unable_to_send_air_news' => '不能发送空消息', 'message_can_not_send' => '对不起,发送短消息失败', 'message_can_not_send1' => '发送失败,您当前超出了24小时最大允许发送短消息数目', 'message_can_not_send2' => '两次发送短消息太快,请稍等一下再发送', 'message_can_not_send3' => '您不能给非好友批量发送短消息', 'message_can_not_send4' => '目前您还不能使用发送短消息功能', 'not_to_their_own_greeted' => '不能向自己打招呼', 'has_been_hailed_overlooked' => '招呼已经忽略了', //source/cp_profile.php 'realname_too_short' => '真实姓名不能少于4个字符', 'update_on_successful_individuals' => '个人资料更新成功了', //source/cp_poll.php 'no_authority_to_add_poll' => '您目前没有权限添加投票', 'no_authority_operation_of_the_poll' => '您没有权限操作该投票', 'add_at_least_two_further_options' => '请至少添加两个不相同的候选项', 'the_total_reward_should_not_overrun' => '您的悬赏总额不能超过\\1', 'wrong_total_reward' => '悬赏总额不能小于平均悬赏额度', 'voting_does_not_exist' => '投票信息不存在', 'already_voted' => '您已经投过票', 'option_exceeds_the_maximum_number_of' => '不能添加了,最大不能超过20个投票项', 'the_total_reward_should_not_be_empty' => '悬赏总额不能为空', 'average_reward_should_not_be_empty' => '平均每人悬赏额度不能为空', 'average_reward_can_not_exceed' => '平均每人悬赏最高不能超过\\1个积分', 'added_option_should_not_be_empty' => '新增加的候选项不能为空', 'time_expired_error' => '过期时间不能小于当前时间', 'please_select_items_to_vote' => '请至少选择一个投票选项', 'fill_in_at_least_an_additional_value' => '请至少添加一种追加类型值', //source/cp_share.php 'blog_does_not_exist' => '指定的日志不存在', 'logs_can_not_share' => '指定的日志因隐私设置不能够被分享', 'album_does_not_exist' => '指定的相册不存在', 'album_can_not_share' => '指定的相册因隐私设置不能够被分享', 'image_does_not_exist' => '指定的图片不存在', 'image_can_not_share' => '指定的图片因隐私设置不能够被分享', 'topics_does_not_exist' => '指定的话题不存在', 'mtag_fieldid_does_not_exist' => '指定的群组分类不存在', 'tag_does_not_exist' => '指定的标签不存在', 'url_incorrect_format' => '分享的网址格式不正确', 'description_share_input' => '请输入分享的描述', 'poll_does_not_exist' => '指定的投票不存在', 'share_not_self' => '你不能分享自己发表的信息(或图片)', 'share_space_not_self' => '你不能分享自己的主页', //source/cp_space.php 'domain_length_error' => '设置的二级域名长度不能小于\\1个字符', 'credits_exchange_invalid' => '兑换的积分方案有错,不能进行兑换,请返回修改。', 'credits_transaction_amount_invalid' => '您要转账或兑换的积分数量输入有误,请返回修改。', 'credits_password_invalid' => '您没有输入密码或密码错误,不能进行积分操作,请返回。', 'credits_balance_insufficient' => '对不起,您的积分余额不足,兑换失败,请返回。', 'extcredits_dataerror' => '兑换失败,请与管理员联系。', 'domain_be_retained' => '您设定的域名被系统保留,请选择其他域名', 'not_enabled_this_feature' => '系统还没有开启本功能', 'space_size_inappropriate' => '请正确指定要兑换的上传空间大小', 'space_does_not_exist' => '对不起,您指定的用户空间不存在。', 'integral_convertible_unopened' => '系统目前没有开启积分兑换功能', 'two_domain_have_been_occupied' => '设置的二级域名已经有人使用了', 'only_two_names_from_english_composition_and_figures' => '设置的二级域名需要由英文字母开头且只由英文和数字构成', 'two_domain_length_not_more_than_30_characters' => '设置的二级域名长度不能超过30个字符', 'old_password_invalid' => '您没有输入旧密码或旧密码错误,请返回重新填写。', 'no_change' => '没有做任何修改', 'protection_of_users' => '受保护的用户,没有权限修改', //source/cp_sendmail.php 'email_input' => '您还没有设置邮箱,请在<a href="cp.php?ac=profile&op=contact">联系方式</a>中准确填写您的邮箱', 'email_check_sucess' => '您的邮箱(\\1)验证激活完成了', 'email_check_error' => '您输入的邮箱验证链接不正确。您可以在个人资料页面,重新接收新的邮箱验证链接。', 'email_check_send' => '验证邮箱的激活链接已经发送到您刚才填写的邮箱,您会在几分钟之内收到激活邮件,请注意查收。', 'email_error' => '填写的邮箱格式错误,请重新填写', //source/cp_theme.php 'theme_does_not_exist' => '指定的风格不存在', 'css_contains_elements_of_insecurity' => '您提交的内容含有不安全元素', //source/cp_upload.php 'upload_images_completed' => '上传图片完成了', //source/cp_thread.php 'to_login' => '您需要先登录才能继续本操作', 'title_not_too_little' => '标题不能少于2个字符', 'posting_does_not_exist' => '指定的话题不存在', 'settings_of_your_mtag' => '有了群组才能发话题,你需要先设置一下你的群组。<br>通过群组,您可以结识与你有相同选择的朋友,更可以一起交流话题。<br><br><a href="cp.php?ac=mtag" class="submit">设置我的群组</a>', 'first_select_a_mtag' => '你至少应该选择一个群组才能发话题。<br><br><a href="cp.php?ac=mtag" class="submit">设置我的群组</a>', 'no_mtag_allow_thread' => '当前你参与的群组加入人数不足,还不能进行发话题操作。<br><br><a href="cp.php?ac=mtag" class="submit">设置我的群组</a>', 'mtag_close' => '选择的群组已经被锁定,不能进行本操作', //source/space_album.php 'to_view_the_photo_does_not_exist' => '出问题了,您要查看的相册不存在', //source/space_blog.php 'view_to_info_did_not_exist' => '出问题了,您要查看的信息不存在或者已经被删除', //source/space_pic.php 'view_images_do_not_exist' => '您要查看的图片不存在', //source/mt_thread.php 'topic_does_not_exist' => '指定的话题不存在', //source/do_inputpwd.php 'news_does_not_exist' => '指定的信息不存在', 'proved_to_be_successful' => '验证成功,现在进入查看页面', 'password_is_not_passed' => '输入的网站登录密码不正确,请返回重新确认', //source/do_login.php 'login_success' => '登录成功了,现在引导您进入登录前页面 \\1', 'not_open_registration' => '非常抱歉,本站目前暂时不开放注册', 'not_open_registration_invite' => '非常抱歉,本站目前暂时不允许用户直接注册,需要有好友邀请链接才能注册', //source/do_lostpasswd.php 'getpasswd_account_notmatch' => '您的账户资料中没有完整的Email地址,不能使用取回密码功能,如有疑问请与管理员联系。', 'getpasswd_email_notmatch' => '输入的Email地址与用户名不匹配,请重新确认。', 'getpasswd_send_succeed' => '取回密码的方法已经通过 Email 发送到您的信箱中,<br />请在 3 天之内修改您的密码。', 'user_does_not_exist' => '该用户不存', 'getpasswd_illegal' => '您所用的 ID 不存在或已经过期,无法取回密码。', 'profile_passwd_illegal' => '密码空或包含非法字符,请返回重新填写。', 'getpasswd_succeed' => '您的密码已重新设置,请使用新密码登录。', 'getpasswd_account_invalid' => '对不起,创始人、受保护用户或有站点设置权限的用户不能使用取回密码功能,请返回。', 'reset_passwd_account_invalid' => '对不起,创始人、受保护用户或有站点设置权限的用户不能使用密码重置功能,请返回。', //source/do_register.php 'registered' => '注册成功了,进入个人空间', 'system_error' => '系统错误,未找到UCenter Client文件', 'password_inconsistency' => '两次输入的密码不一致', 'profile_passwd_illegal' => '密码空或包含非法字符,请重新填写。', 'user_name_is_not_legitimate' => '用户名不合法', 'include_not_registered_words' => '用户名包含不允许注册的词语', 'user_name_already_exists' => '用户名已经存在', 'email_format_is_wrong' => '填写的 Email 格式有误', 'email_not_registered' => '填写的 Email 不允许注册', 'email_has_been_registered' => '填写的 Email 已经被注册', 'regip_has_been_registered' => '同一个IP在 \\1 小时内只能注册一个账号', 'register_error' => '注册失败', //tag.php 'tag_does_not_exist' => '指定的标签不存在', //cp_poke.php 'poke_success' => '已经发送,\\1下次访问时会收到通知', 'mtag_minnum_erro' => '本群组成员数不足 \\1 个,还不能进行本操作', //source/function_common.php 'information_contains_the_shielding_text' => '对不起,发布的信息中包含站点屏蔽的文字', 'site_temporarily_closed' => '站点暂时关闭', 'ip_is_not_allowed_to_visit' => '不能访问,您当前的IP不在站点允许访问的范围内。', 'no_data_pages' => '指定的页面已经没有数据了', 'length_is_not_within_the_scope_of' => '分页数不在允许的范围内', //source/function_block.php 'page_number_is_beyond' => '页数是否超出范围', //source/function_cp.php 'incorrect_code' => '输入的验证码不符,请重新确认', //source/function_space.php 'the_space_has_been_closed' => '您要访问的空间已被删除,如有疑问请联系管理员', //source/network_album.php 'search_short_interval' => '两次搜索间隔太短,请等待 \\1 秒后再重试 (<a href="\\2">重新搜索</a>)', 'set_the_correct_search_content' => '对不起,请设置正确的查找内容', //source/space_share.php 'share_does_not_exist' => '要查看的分享不存在', //source/space_tag.php 'tag_locked' => '标签已经被锁定', 'invite_error' => '无法获取好友邀请码,请确认您是否有足够的积分来进行本操作', 'invite_code_error' => '对不起,您访问的邀请链接不正确,请确认。', 'invite_code_fuid' => '对不起,您访问的邀请链接已经被他人使用了。', //source/do_invite.php 'should_not_invite_your_own' => '对不起,您不能通过访问自己的邀请链接来邀请自己。', 'close_invite' => '对不起,系统已经关闭了好友邀请功能', 'field_required' => '个人资料中的必填项目“\\1” 不能为空,请确认', 'friend_self_error' => '对不起,您不能加自己为好友', 'change_friend_groupname_error' => '指定的好友用户组不能被操作', 'mtag_not_allow_to_do' => '您不是该话题所在群组的成员,没有权限进行本操作', //cp_task 'task_unavailable' => '您要参与的有奖任务不存在或者还没有开始,无法继续操作', 'task_maxnum' => '您要参与的有奖任务已经到达允许人数的上限了,该任务自动失效', 'update_your_mood' => '请先更新一下您现在的心情状态吧', 'showcredit_error' => '填写的数字需要大于0,并且小于您的积分数,请确认', 'showcredit_fuid_error' => '您指定的用户还不是你的好友,请确认', 'showcredit_do_success' => '您已经成功增加上榜积分,赶快查看自己的最新排名吧', 'showcredit_friend_do_success' => '您已经成功赠送好友上榜积分,好友会收到通知的', 'submit_invalid' => '您的请求来路不正确或表单验证串不符,无法提交。请尝试使用标准的web浏览器进行操作。', 'no_privilege_my_status' => '对不起,当前站点已经关闭了用户多应用服务。', 'no_privilege_myapp' => '对不起,该应用不存在或已关闭,您可以<a href="cp.php?ac=userapp&my_suffix=%2Fapp%2Flist">选择其他应用</a>', 'report_error' => '对不起,请正确指定要举报的对象', 'report_success' => '感谢您的举报,我们会尽快处理', 'manage_no_perm' => '您只能对自己发布的信息进行管理<a href="javascript:;" onclick="hideMenu();">[关闭]</a>', 'repeat_report' => '对不起,请不要重复举报', 'the_normal_information' => '要举报的对象被管理员视为没有违规,不需要再次举报了', 'friend_ignore_next' => '成功忽略用户 \\1 的好友申请,继续处理下一个请求中(<a href="cp.php?ac=friend&op=request">停止</a>)', 'friend_addconfirm_next' => '您已经跟 \\1 成为了好友,继续处理下一个好友请求中(<a href="cp.php?ac=friend&op=request">停止</a>)', //source/cp_event.php 'event_title_empty'=>'活动名称不能为空', 'event_classid_empty'=>'必须选择活动分类', 'event_city_empty'=>'必须选择活动城市', 'event_detail_empty'=>'必须填写活动介绍', 'event_bad_time_range'=>'活动持续时间不能超过60天', 'event_bad_endtime'=>'活动结束时间不能早于开始时间', 'event_bad_deadline'=>'活动报名截止时间不能晚于活动结束时间', 'event_bad_starttime'=>'活动开始时间不能早于现在', 'event_already_full'=>'此活动参与人数已满', 'event_will_full' => '人数将超过活动参与人数限制', 'no_privilege_add_event'=>'您没有权限发起新活动', 'no_privilege_edit_event'=>'您没有权限编辑这个活动的信息', 'no_privilege_manage_event_members' =>'您没有权限管理这个活动的成员', 'no_privilege_manage_event_comment' => '您没有权限管理这个活动的评论', 'no_privilege_manage_event_pic' => '您没有权限管理这个活动的相册', 'no_privilege_do_eventinvite' =>'您没有权限发送活动邀请', 'event_does_not_exist'=>'活动不存在或已被删除', 'event_create_failed'=>'创建活动失败,请检查您的输入信息', 'event_need_verify'=>'活动创建成功,等待管理员审核', 'upload_photo_failed'=>'上传活动海报失败', 'choose_right_eventmember'=>'请选择合适的活动成员进行操作', 'choose_event_pic'=>'请选择活动照片', 'only_creator_can_set_admin'=>'只有创建者可以设置其他组织者', 'event_not_set_verify'=>'活动不需要审核', 'event_join_limit'=>'此活动只有通过邀请才能加入', 'cannot_quit_event'=>'您不能退出活动,因为您还没有加入活动或者您是这个活动的发起人', 'event_not_public'=>'这是一个非公开活动,只有通过邀请才能查看', 'no_privilege_do_event_invite' => '此活动不允用户邀请好友', 'event_under_verify' => '此活动正在审核中', 'cityevent_under_condition' => '要浏览同城活动,需要先设置您的居住地', 'event_is_over' => '此活动已经结束', 'event_meet_deadline'=>'活动已经截止报名', 'bad_userevent_status'=>'请选择正确的活动成员状态', 'event_has_followed'=>'您已经关注了此活动', 'event_has_joint'=>'您已经加入了此活动', 'event_is_closed'=>'活动已经关闭', 'event_only_allows_members_to_comment'=>'此活动只允许活动成员发表留言', 'event_only_allows_admins_to_upload'=>'此活动只有组织者可以上传照片', 'event_only_allows_members_to_upload'=>'只有活动成员可以上传活动照片', 'eventinvite_does_not_exist'=>'您没有该活动的活动邀请', 'event_can_not_be_opened' => '此活动现在不能被开启', 'event_can_not_be_closed' => '此活动现在不能被关闭', 'event_only_allows_member_thread' => '只有活动成员才能发表或回复活动话题', 'event_mtag_not_match' => '指定群组没有关联到本活动', 'event_memberstatus_limit' => '此活动为私密活动,只有活动成员才能访问', 'choose_event_thread' => '请选择至少一个活动话题进行操作', //source/cp_magic.php 'magicuse_success' => '道具使用成功了', 'unknown_magic' => '指定的道具不存在或已被禁止使用', 'choose_a_magic' => '请选择一个道具', 'magic_is_closed' => '此道具已被禁用', 'magic_groupid_not_allowed' => '您所在的用户组没有权限使用道具', 'input_right_buynum' => '请正确输入要购买的数量', 'credit_is_not_enough' => '您的积分不够购买此道具', 'not_enough_storage' => '道具库存量不足,下次补给时间是 \\1', 'magicbuy_success' => '道具购买成功,花费积分 \\1', 'magicbuy_success_with_experence' => '道具购买成功,花费积分 \\1, 增加经验 \\2', 'bad_friend_username_given' => '输入的好友名无效', 'has_no_more_present_magic' => '您还没有道具转让许可证,<a id="a_buy_license" href="cp.php?ac=magic&op=buy&mid=license" onclick="ajaxmenu(event, this.id, 1)">马上去购买</a>', 'has_no_more_magic' => '您还没有道具 \\1,<a id="\\2" href="\\3" onclick="ajaxmenu(event, this.id, 1)">立刻购买</a>', 'magic_can_not_be_presented' => '此道具不能被赠送', 'magicpresent_success' => '已成功向 \\1 赠送了道具', 'magic_store_is_closed' => '道具商店已经关闭', 'magic_not_used_under_right_stage' => '此道具不能在当前场景使用', 'magic_groupid_limit' => '您当前所在的用户组不能购买该道具', 'magic_usecount_limit' => '受道具使用周期限制,您现在还不能使用此道具。<br>请于 \\1 之后使用', 'magicuse_note_have_no_friend' => '您没有任何好友', 'magicuse_author_limit' => '此道具只能对自己发布的信息使用', 'magicuse_object_count_limit' => '此道具对同一信息使用次数已达到上限(\\1 次)', 'magicuse_object_once_limit' => '已经对该信息使用过此道具,不能重复使用', 'magicuse_bad_credit_given' => '您输入的积分数无效', 'magicuse_not_enough_credit' => '您输入的积分数超过所当前拥有的积分', 'magicuse_bad_chunk_given' => '您输入的单份积分数无效', 'magic_gift_already_given_out' => '红包已经被领完了', 'magic_got_gift' => '您已经领取到了红包:增加 \\1 个积分', 'magic_had_got_gift' => '您已经领取过此次红包了', 'magic_has_no_gift' => '当前空间没有设置红包', 'magicuse_object_not_exist' => '道具的作用对象不存在', 'magicuse_bad_object' => '没有正确选择道具要作用的对象', 'magicuse_condition_limit' => '道具的发起条件不足', 'magicuse_bad_dateline' => '输入的时间无效', 'magicuse_not_click_yet' => '您还没有对该信息表态过', 'not_enough_coupon' => '代金券数目不足', 'magicuse_has_no_valid_friend' => '道具使用失败,没有任何合法的好友', 'magic_not_hidden_yet' => '您现在不是隐身状态', 'magic_not_for_sale' => '此道具不能通过购买获得', 'not_set_gift' => '您当前没有设置红包', 'not_superstar_yet' => '您还不是超级明星', 'no_flicker_yet' => '您还没有对此信息使用彩虹炫', 'no_color_yet' => '您还没有对此信息使用彩色灯', 'no_frame_yet' => '您还没有对此信息使用相框', 'no_bgimage_yet' => '您还没有对此信息使用信纸', 'bad_buynum' => '您输入的购买数目有误', 'feed_no_found' => '指定要查看的动态不存在', 'not_open_updatestat' => '站点没有开启趋势统计功能', 'topic_subject_error' => '标题长度不要少于4个字符', 'topic_no_found' => '指定要查看的热闹不存在', 'topic_list_none' => '目前还没有可以参与的热闹', 'space_has_been_locked' => '空间已被锁定无法访问,如有疑问请联系管理员', ); ?>
zyyhong
trunk/jiaju001/newbbs/home/language/lang_showmessage.php
PHP
asf20
28,219
<?php if(!defined('IN_UCHOME')) exit('Access Denied'); $_SGLOBAL['usergroup']=Array ( 9 => Array ( 'gid' => 9, 'grouptitle' => '禁止访问', 'system' => -1, 'banvisit' => 1, 'explower' => '0', 'maxfriendnum' => 1, 'maxattachsize' => 1048576, 'allowhtml' => '0', 'allowcomment' => '0', 'searchinterval' => 9999, 'searchignore' => '0', 'postinterval' => 9999, 'spamignore' => '0', 'videophotoignore' => '0', 'allowblog' => '0', 'allowdoing' => '0', 'allowupload' => '0', 'allowshare' => '0', 'allowmtag' => '0', 'allowthread' => '0', 'allowpost' => '0', 'allowcss' => '0', 'allowpoke' => '0', 'allowfriend' => '0', 'allowpoll' => '0', 'allowclick' => '0', 'allowevent' => '0', 'allowmagic' => '0', 'allowpm' => '0', 'allowviewvideopic' => '0', 'allowmyop' => '0', 'allowtopic' => '0', 'allowstat' => '0', 'magicdiscount' => '0', 'verifyevent' => 1, 'edittrail' => '0', 'domainlength' => 99, 'closeignore' => '0', 'seccode' => 1, 'color' => '', 'icon' => '', 'manageconfig' => '0', 'managenetwork' => '0', 'manageprofilefield' => '0', 'manageprofield' => '0', 'manageusergroup' => '0', 'managefeed' => '0', 'manageshare' => '0', 'managedoing' => '0', 'manageblog' => '0', 'managetag' => '0', 'managetagtpl' => '0', 'managealbum' => '0', 'managecomment' => '0', 'managemtag' => '0', 'managethread' => '0', 'manageevent' => '0', 'manageeventclass' => '0', 'managecensor' => '0', 'managead' => '0', 'managesitefeed' => '0', 'managebackup' => '0', 'manageblock' => '0', 'managetemplate' => '0', 'managestat' => '0', 'managecache' => '0', 'managecredit' => '0', 'managecron' => '0', 'managename' => '0', 'manageapp' => '0', 'managetask' => '0', 'managereport' => '0', 'managepoll' => '0', 'manageclick' => '0', 'managemagic' => '0', 'managemagiclog' => '0', 'managebatch' => '0', 'managedelspace' => '0', 'managetopic' => '0', 'manageip' => '0', 'managehotuser' => '0', 'managedefaultuser' => '0', 'managespacegroup' => '0', 'managespaceinfo' => '0', 'managespacecredit' => '0', 'managespacenote' => '0', 'managevideophoto' => '0', 'managelog' => '0', 'magicaward' => '' ) ) ?>
zyyhong
trunk/jiaju001/newbbs/home/data/data_usergroup_9.php
PHP
asf20
2,259