$value) { if ($key == 'YZONE_blog_auth') { $authcookie = $value; } } if (isset($authcookie)) { $str = md5($uid) . strtotime(date('Y-m-d')); $str = md5($str); if ($authcookie == $str) { $cookietime = 2592000; $ss_auth_key = md5($_SCONFIG['sitekey'].$_SERVER['HTTP_USER_AGENT']); include_once(S_ROOT.'./class/db_mysql.class.php'); //链接数据库 dbconnect(); $query = $_SGLOBAL['db'] -> query("SELECT * FROM ".tname('members')." WHERE uid='$uid'"); if($member = $_SGLOBAL['db'] -> fetch_array($query)) { ssetcookie('sid', '', -86400 * 365); ssetcookie('cookietime', $cookietime, 31536000); ssetcookie('auth', authcode("$member[password]\t$member[secques]\t$member[uid]", 'ENCODE', $ss_auth_key), $cookietime); } else { ssetcookie('cookietime', $cookietime, 31536000); ssetcookie('loginuser', $get['username'], $cookietime); ssetcookie('activationauth', authcode($get['username'], 'ENCODE', $ss_auth_key), $cookietime); } } } //获取空间信息 $space = getuserspace($uid); if(empty($space)) { dbconnect(1); $query = $_SGLOBAL['db_bbs']->query("SELECT m.uid, m.groupid, m.username, m.regdate, m.lastvisit, m.posts, mf.avatar FROM ".tname('members', 1)." m LEFT JOIN ".tname('memberfields', 1)." mf ON mf.uid=m.uid WHERE m.uid='$uid'"); if($space = $_SGLOBAL['db']->fetch_array($query)) { //判断是否有权限自动拥有空间/没有跳转到个人资料 if(!empty($blackgroupids) && in_array($space['groupid'], $blackgroupids)) sheader(B_URL.'/space.php?uid='.$uid); include_once(S_ROOT.'./include/common.inc.php'); //判断是否本人 @include_once(S_ROOT.'./data/system/group.cache.php'); // added by lwx at 2009-6-8 14:17 $space['username'] = dz_apply_filters('get_fixed_username', $space); // end of hook $space['spacename'] = $space['username'].$lang['personal_space']; $space['othernum'] = 10; $space['group'] = array(); if(!empty($_SGLOBAL['grouparr'][$space['groupid']])) $space['group'] = $_SGLOBAL['grouparr'][$space['groupid']]; getcookie(); $space['showcp'] = 0; if($uid == $_SGLOBAL['supe_uid']) { if(!empty($space['group']['allowspace'])) $space['showcp'] = 1; } // added by lwx at 2009-9-9 11:05 if ($space['showcp'] == 1) { sheader('/register'); } // end of hook $space['photo'] = $space['avatar']; if(empty($space['photo'])) { $space['photo'] = S_URL.'/images/base/space_noface.gif'; } elseif(!strexists($space['photo'], '://')) { $space['photo'] = B_URL.'/'.$space['photo']; } // added by lwx at 2009-7-16 14:58 $space['photo'] = dz_apply_filters('get_user_avatar_url', $space['uid'], $uid, 'middle'); // end of hook $space['sightml'] = ''; //页面标题 $title = $space['spacename'].' - '.$_SCONFIG['sitename'].' '.$_SCONFIG['seotitle']; include_once(S_ROOT.'./include/space_nospace.inc.php'); ob_out(); exit(); } else { // added by lwx at 2009-9-15 9:28 // 未同步用户 include_once(S_ROOT.'./uc_client/client.php'); if ($userdata = uc_get_user($uid, true)) { @list($uid, $username, $email, $secques, $nickname) = $userdata; $uid = intval($uid); $password = md5(time()); $query = $_SGLOBAL['db']->query('SELECT COUNT(*) FROM '.tname('userspaces').' WHERE uid=\''.$uid.'\''); $havespace = (int) $_SGLOBAL['db']->result($query, 0); $insertsqlarr = array( 'uid' => $uid, 'groupid' => 10, 'username' => addslashes($username), 'password' => $password, 'secques' => addslashes($secques), 'timeoffset' => 9999, 'dateformat' => 0, 'havespace' => $havespace, 'newpm' => 0, 'nickname' => addslashes($nickname), ); replacetable('members', $insertsqlarr); $synuserscript = uc_user_synuser($uid, $username, $password, $email, $nickname); // 判断是否有账号激活信息 global $cookiepre; $activationauth = empty($_COOKIE[$cookiepre.'activationauth']) ? '' : $_COOKIE[$cookiepre.'activationauth']; $theusername = authcode($activationauth, 'DECODE'); if ($theusername == $username) { // 设置登录cookie $cookietime = 0; $cookievalue = authcode("$password\t$secques\t$uid", 'ENCODE'); ssetcookie('sid', '', $cookietime); ssetcookie('auth', $cookievalue, $cookietime); setcookie('_refer', ''); $message = '您的博客还未开通,现转到博客开通页面。'; $url = '/register'; } else { $message = '跳转中……'; $url = "/$uid?refresh=yes"; } messagebox('ok', $message.$synuserscript, $url); } else { messagebox('error', 'not_found');//不存在的用户 } // end of hook } } else { $musicmsgs = @unserialize($space['music']); $musicload = empty($_SGET['notloaded'])?1:0; if(!empty($musicmsgs['mp3list']) && $musicload) { // 非跨页播放 if(empty($musicmsgs['config']['passpage'])){ //if(empty($_SGET['noframe'])) { // echo ''; //} }else { $_SCONFIG['htmlspace'] = 0; $_SGET['noframe'] = !empty($_GET['noframe']) ? $_GET['noframe'] : $_SGET['noframe']; if(empty($_SGET['noframe'])) { echo ''; exit(); } } } //空间锁定 if($space['islock']) { $_SCONFIG['htmlspace'] = 0; getcookie(1); if($uid != $_SGLOBAL['supe_uid'] && $_SGLOBAL['member']['groupid'] != 1) messagebox('error', 'space_lock'); } else { // removed by lwx at 2009-6-17 11:23 //getcookie(0); // added by lwx at 2009-6-17 11:23 getcookie(1); // end of hook } $isupdate = freshcookie('u'.$uid); //个人 $spaceself = 0; if($uid == $_SGLOBAL['supe_uid']) { $spaceself = 1; $space['showcp'] = 1; $_SGET['php'] = 1; } else { $space['showcp'] = 0; //留下脚印 if($isupdate && $_SGLOBAL['supe_uid']) { $_SGLOBAL['db']->query("REPLACE INTO ".tname('visitors')." (uid, visitoruid, dateline) VALUES ('$uid', '$_SGLOBAL[supe_uid]', '$_SGLOBAL[timestamp]')"); // added by lwx at 2009-7-13 14:33 //if (is_internal_ip()) { // 清除缓存 require_once(S_ROOT.'./function/common.func.php'); $_SGLOBAL['db']->query( "DELETE FROM ".getspacecachetablename( $uid )." WHERE uid='{$uid}' AND cacheid=4 ", "SILENT" ); //dd($isupdate , $_SGLOBAL['supe_uid']); //} } } //CSS预览 if(!empty($_SGET['css'])) $_SCONFIG['htmlspace'] = 0; //html静态 if(!empty($_SCONFIG['htmlspace'])) { $_SHTML['uid'] = $uid; $_SHTML['action'] = 'space'; $_SHTML['noframe'] = $_SGET['noframe']; $_SGLOBAL['htmlfile'] = gethtmlfile($_SHTML); ehtml('get', $_SCONFIG['htmlspacetime']); $_SCONFIG['debug'] = 0; $space['showcp'] = 0;//不显示快捷管理 } //更新空间查看数 if($isupdate || !$_SCONFIG['updateview']) updatespaceviewnum($uid); include_once(S_ROOT.'./include/common.inc.php'); //页面标题 $title = $space['spacename'].' - '.$_SCONFIG['sitename'].' '.$_SCONFIG['seotitle'].' - Powered by X-Space'; $keywords = $space['username'].','.$space['province'].','.$space['city']; $description = $space['announcement']; // removed by lwx at 2009-6-22 13:30 //$turl = empty($musicmsgs['config']['passpage'])?geturl("uid/$uid"):geturl("uid/$uid/notloaded/1"); // added by lwx at 2009-6-22 13:30 $turl = S_URL."/$uid/"; if ( !empty($musicmsgs['config']['passpage']) ) { $turl .= '?noframe=1'; } // end of hook $thepagename = ''.$lang['front_page_space'].''; //页面特效 $effect = ''; if(!empty($space['flash'])) { @include_once(S_ROOT.'./data/system/effect.cache.php'); if(isset($_SGLOBAL['effect'][$space['flash']])) { $flashurl = $_SGLOBAL['effect'][$space['flash']]['file']; $flashurl = str_replace('SITEURL', S_URL, $flashurl); } else { $flashurl = $space['flash']; } $flashurl = shtmlspecialchars($flashurl);//非html化 $effect .= ''; } //页面公告 if (strpos('str_'.$_SCONFIG['allowannounce'], 'front')) { @include_once(S_ROOT.'./data/system/announcement.cache.php'); $sitemsg = ''; if (empty($_SGLOBAL['announcement'])) { $_SGLOBAL['announcement'] = array(); } foreach ($_SGLOBAL['announcement'] as $key => $listvalue) { $sitemsg .= '