} require_once DISCUZ_ROOT . './include/space.func.php'; include_once DISCUZ_ROOT . './forumdata/cache/cache_forums.php'; include_once language('spaces'); $member = $db->fetch_first("SELECT m.*, mf.*, s.lastactivity as online\r\n\tFROM {$tablepre}members m\r\n\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\tLEFT JOIN {$tablepre}sessions s ON s.uid=m.uid AND s.invisible='0'\r\n\tWHERE " . ($uid ? "m.uid='{$uid}'" : "m.username='******'") . " LIMIT 1"); if (!$member) { showmessage('member_nonexistence'); } $uid = $member['uid']; if ($spacestatus && $supe['status'] && $member['xspacestatus']) { dheader("location: {$supe['siteurl']}?uid/{$uid}"); } if (!$spacestatus || in_array($member['groupid'], array(4, 5, 6))) { dheader("location: {$boardurl}space.php?action=viewpro&uid={$uid}"); } $spacesettings = getspacesettings($uid); if (!empty($preview) && $uid == $discuz_uid) { $spacesettings['layout'] = explode('|', $preview); $spacesettings['side'] = intval($spaceside); } else { $spacesettings['layout'] = explode("\t", $spacesettings['layout']); } if (!empty($style)) { $spacesettings['style'] = str_replace('/', '', $style); if (!file_exists(DISCUZ_ROOT . './mspace/' . $spacesettings['style'] . '/style.ini')) { showmessage('space_style_nofound', NULL, 'HALTED'); } } $layout = $moduledata = array(); foreach ($spacesettings['layout'] as $k => $layoutitem) { $layout[$k] = explode('][', ']' . $layoutitem . '[');
$query = $db->query("SELECT t.fid, t.special, t.price, t.attachment, t.authorid, t.author, t.dateline, t.replies, t.closed, m.groupid, p.pid, p.subject, p.message, p.htmlon, p.smileyoff, p.bbcodeoff, p.attachment, p.rate, p.ratetimes\r\n\tFROM {$tablepre}threads t\r\n\tINNER JOIN {$tablepre}posts p ON p.tid=t.tid AND p.invisible='0'\r\n\tLEFT JOIN {$tablepre}members m ON m.uid=t.authorid\r\n\tWHERE t.tid='{$tid}' AND t.blog='1' AND t.displayorder>='0' ORDER BY p.dateline LIMIT 1"); if (!($blogtopic = $db->fetch_array($query))) { showmessage('blog_topic_nonexistence'); } $uid = $blogtopic['authorid']; $page = max(1, intval($page)); $start_limit = ($page - 1) * $ppp; $query = $db->query("SELECT m.*, mf.*\r\n\tFROM {$tablepre}members m\r\n\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\tWHERE m.uid='{$uid}' LIMIT 1"); $member = $db->fetch_array($query); if (!$spacestatus) { dheader("location: {$boardurl}"); } if ($supe['status'] && $member['xspacestatus']) { dheader("location: {$supe['siteurl']}?uid/{$uid}"); } $spacesettings = getspacesettings($member['uid']); $menulist = array(); $modulelist = explode('][', ']' . str_replace("\t", '', $spacesettings['layout']) . '['); foreach ($modulelist as $module) { if (array_key_exists($module, $listmodule)) { $menulist[$listmodule[$module]] = $module; } } ksort($menulist); $showsettings = str_pad(decbin($showsettings), 3, '0', STR_PAD_LEFT); $customshow = $discuz_uid ? str_pad(base_convert($customshow, 10, 3), 3, '0', STR_PAD_LEFT) : '222'; $showimages = $customshow[2] == 2 ? $showsettings[2] : $customshow[2]; $attachtags = array(); $attachpids = $viewattachlist = 0; $username = $blogtopic['author']; $multipage = $multipage = spacemulti($blogtopic['replies'], $ppp, $page, "blog.php?tid={$tid}");
} else { $oltimeadd1 = $oltimeadd2 = ''; } $member = $db->fetch_first("SELECT m.*, mf.*, u.grouptitle, u.type, u.creditshigher, u.creditslower, u.readaccess,\r\n\t\tu.color AS groupcolor, u.stars AS groupstars, u.allownickname, u.allowuseblog, r.ranktitle,\r\n\t\tr.color AS rankcolor, r.stars AS rankstars {$oltimeadd1}\r\n\t\tFROM {$tablepre}members m\r\n\t\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\t\tLEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid\r\n\t\tLEFT JOIN {$tablepre}ranks r ON m.posts>=r.postshigher\r\n\t\t{$oltimeadd2}\r\n\t\tWHERE " . ($uid ? "m.uid='{$uid}'" : "m.username='******'") . "ORDER BY r.postshigher DESC LIMIT 1"); if (!$member) { showmessage('member_nonexistence'); } $uid = $member['uid']; $member['online'] = $db->result_first("SELECT lastactivity FROM {$tablepre}sessions WHERE uid='{$uid}' AND invisible='0'"); if ($member['groupid'] != ($member['groupidnew'] = getgroupid($member['uid'], $member, $member))) { $member = array_merge($member, $db->fetch_first("SELECT groupid, grouptitle, type, creditshigher, creditslower, color AS groupcolor,\r\n\t\tstars AS groupstars, allownickname, allowuseblog\r\n\t\tFROM {$tablepre}usergroups WHERE groupid='{$member['groupidnew']}'")); } $viewspace = !$inajax && $spacestatus && (!$supe['status'] || !$member['xspacestatus']) && !in_array($member['groupid'], array(4, 5, 6)); if ($viewspace) { include_once DISCUZ_ROOT . './include/space.func.php'; if (!($spacesettings = getspacesettings($member['uid']))) { dheader("location: {$boardurl}"); } include_once language('spaces'); $modulelist = explode('][', ']' . str_replace("\t", '', $spacesettings['layout']) . '['); foreach ($modulelist as $module) { if (array_key_exists($module, $listmodule)) { $menulist[$listmodule[$module]] = $module; } } ksort($menulist); } $modforums = $comma = ''; if ($member['adminid'] > 0) { $query = $db->query("SELECT m.fid, f.name, f.type FROM {$tablepre}moderators m, {$tablepre}forums f WHERE m.uid='{$member['uid']}' AND m.inherited='0' AND f.fid=m.fid"); while ($forum = $db->fetch_array($query)) {
if (empty($spacelayout[2])) { $spaceside = 1; } } $db->query("UPDATE {$tablepre}memberfields SET spacename = '" . dhtmlspecialchars(trim($spacename)) . "' WHERE uid='{$discuz_uid}'"); $spacelayout = implode("\t", $spacelayout); $spaceside = intval($spaceside); if (!array_key_exists($spacestyle, $spacestyles)) { showmessage('space_style_nofound', NULL, 'HALTED'); } $spacestyle = addslashes($spacestyle); $db->query("UPDATE {$tablepre}memberspaces SET description= '" . dhtmlspecialchars($spacedescription) . "', layout='{$spacelayout}', side='{$spaceside}', style='{$spacestyle}' WHERE uid='{$discuz_uid}'"); $db->query("DELETE FROM {$tablepre}spacecaches WHERE uid='{$uid}'"); showmessage('space_setting_succeed', "space.php?{$discuz_uid}"); } $spacename = $db->result_first("SELECT spacename FROM {$tablepre}memberfields WHERE uid='{$discuz_uid}'"); $spacesettings = getspacesettings($discuz_uid); $spacesettings['name'] = $spacename; $spacepath = 'mspace/'; $menulist = $modulelist = array(); $spacesettings['layout'] = explode("\t", $spacesettings['layout']); foreach ($spacesettings['layout'] as $k => $layoutitem) { $layout[$k] = explode('][', ']' . $layoutitem . '['); $layout[$k] = array_slice($layout[$k], 1, count($layout[$k]) - 2); } $menuarray = array_flip($listmodule); ksort($menuarray); $layoutjs = '\'' . implode('\',\'', $spacesettings['layout']) . '\''; include template('space_module'); include template('memcp_spacemodule'); }