Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 哪位大哥帮我修改home_space.php实现访问个人空间跳转到首页 有X2.5的参考方法

[复制链接]
wjy0 发表于 2013-8-3 22:03:16 | 显示全部楼层 |阅读模式
我看到论坛有人发X2.5的修改home_space.php的方法  但是我不懂php看不懂代码 哪位大哥帮我看看该怎么修改这个文件

参考帖 https://discuz.dismall.com/forum.php?mod=viewthread&tid=3224013

X3的这个文件代码

<?php

/**
*      [Discuz!] (C)2001-2099 Comsenz Inc.
*      This is NOT a freeware, use is subject to license terms
*
*      $Id: home_space.php 32383 2013-01-07 11:00:48Z zhangguosheng $
*/

if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}

$dos = array('index', 'doing', 'blog', 'album', 'friend', 'wall',
'notice', 'share', 'home', 'pm', 'videophoto', 'favorite',
'thread', 'trade', 'poll', 'activity', 'debate', 'reward', 'profile', 'plugin', 'follow');

$do = (!empty($_GET['do']) && in_array($_GET['do'], $dos))?$_GET['do']:'index';

if(!in_array($do, array('home', 'doing', 'blog', 'album', 'share', 'wall'))) {
$_G['mnid'] = 'mn_common';
}
if(empty($_G['uid']) && in_array($_GET['do'], array('thread', 'trade', 'poll', 'activity', 'debate', 'reward'))) {
showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1));
}
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);

$member = array();
if($_GET['username']) {
$member = C::t('common_member')->fetch_by_username($_GET['username']);
if(empty($member) && !($member = C::t('common_member_archive')->fetch_by_username($_GET['username']))) {
  showmessage('space_does_not_exist');
}
$uid = $member['uid'];
$member['self'] = $uid == $_G['uid'] ? 1 : 0;
}

if($_GET['view'] == 'admin') {
$_GET['do'] = $do;
}
if(empty($uid) || in_array($do, array('notice', 'pm'))) $uid = $_G['uid'];
if(empty($_GET['do']) && !isset($_GET['diy'])) {
if($_G['adminid'] == 1) {
  if($_G['setting']['allowquickviewprofile']) {
   if(!$_G['inajax']) dheader("Location:home.php?mod=space&uid=$uid&do=profile");
  }
}
if(helper_access::check_module('follow')) {
  $do = $_GET['do'] = 'follow';
} else {
  $do = $_GET['do'] = !$_G['setting']['homepagestyle'] ? 'profile' : 'index';
}
} elseif(empty($_GET['do']) && isset($_GET['diy']) && !empty($_G['setting']['homepagestyle'])) {
$_GET['do'] = 'index';
}

if($_GET['do'] == 'follow') {
if($uid != $_G['uid']) {
  $_GET['do'] = 'view';
  $_GET['uid'] = $uid;
}
require_once libfile('home/follow', 'module');
exit;
} elseif(empty($_GET['do']) && !$_G['inajax'] && !helper_access::check_module('follow')) {
$do = 'profile';
}

if($uid && empty($member)) {
$space = getuserbyuid($uid, 1);
if(empty($space)) {
  showmessage('space_does_not_exist');
}
} else {
$space = &$member;
}

if(empty($space)) {
if(in_array($do, array('doing', 'blog', 'album', 'share', 'home', 'trade', 'poll', 'activity', 'debate', 'reward', 'group'))) {
  $_GET['view'] = 'all';
  $space['uid'] = 0;
} else {
  showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1));
}
} else {

$navtitle = $space['username'];

if($space['status'] == -1 && $_G['adminid'] != 1) {
  showmessage('space_has_been_locked');
}

if(in_array($space['groupid'], array(4, 5, 6)) && ($_G['adminid'] != 1 && $space['uid'] != $_G['uid'])) {
  $_GET['do'] = $do = 'profile';
}

if($do != 'profile' && $do != 'index' && !ckprivacy($do, 'view')) {
  $_G['privacy'] = 1;
  require_once libfile('space/profile', 'include');
  include template('home/space_privacy');
  exit();
}

if(!$space['self'] && $_GET['view'] != 'eccredit' && $_GET['view'] != 'admin') $_GET['view'] = 'me';

get_my_userapp();

get_my_app();
}

$diymode = 0;

$seccodecheck = $_G['setting']['seccodestatus'] & 4;
$secqaacheck = $_G['setting']['secqaa']['status'] & 2;
if($do != 'index') {
$_G['disabledwidthauto'] = 0;
}
require_once libfile('space/'.$do, 'include');

?>








 楼主| wjy0 发表于 2013-8-5 15:00:02 | 显示全部楼层
行了  马大哈啊!!!
回复

使用道具 举报

Bacysoft.cn 发表于 2013-8-6 11:43:26 | 显示全部楼层
wjy0 发表于 2013-8-5 15:00
行了  马大哈啊!!!

你自己整好了?
回复

使用道具 举报

 楼主| wjy0 发表于 2013-8-7 22:53:47 | 显示全部楼层

嗯嗯  可以了  是我自己太焦躁了没认真看代码!代码跟discuz X2.5的一样!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-14 17:12 , Processed in 0.024182 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表