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

 找回密码
 立即注册
搜索

上传头像的路径在哪里修改

[复制链接]
wujiaxi0428 发表于 2009-10-11 13:26:36 | 显示全部楼层 |阅读模式
本帖最后由 wujiaxi0428 于 2009-10-11 15:49 编辑

我想修改一下头像上传的路径,但是不知道找哪里修改.谁知道??

有人说是修改ucenter下的avatar.php文件

谁能够说详细点吗..谢谢各位GGJJ了


修改哪一句呀,谁知道

<?php

/*
        [UCenter] (C)2001-2009 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $Id: avatar.php 910 2008-12-30 03:51:44Z monkey $
*/


error_reporting(0);

define('UC_API', strtolower(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER

['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));

$uid = isset($_GET['uid']) ? $_GET['uid'] : 0;
$size = isset($_GET['size']) ? $_GET['size'] : '';
$random = isset($_GET['random']) ? $_GET['random'] : '';
$type = isset($_GET['type']) ? $_GET['type'] : '';
$check = isset($_GET['check_file_exists']) ? $_GET['check_file_exists'] : '';

$avatar = './data/avatar/'.get_avatar($uid, $size, $type);
if(file_exists(dirname(__FILE__).'/'.$avatar)) {
        if($check) {
                echo 1;
                exit;
        }
        $random = !empty($random) ? rand(1000, 9999) : '';
        $avatar_url = empty($random) ? $avatar : $avatar.'?random='.$random;
} else {
        if($check) {
                echo 0;
                exit;
        }
        $size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle';
        $avatar_url = 'images/noavatar_'.$size.'.gif';
}

if(empty($random)) {
        header("HTTP/1.1 301 Moved Permanently");
        header("Last-Modified:".date('r'));
        header("Expires: ".date('r', time() + 86400));
}

header('Location: '.UC_API.'/'.$avatar_url);
exit;

function get_avatar($uid, $size = 'middle', $type = '') {
        $size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle';
        $uid = abs(intval($uid));
        $uid = sprintf("%09d", $uid);
        $dir1 = substr($uid, 0, 3);
        $dir2 = substr($uid, 3, 2);
        $dir3 = substr($uid, 5, 2);
        $typeadd = $type == 'real' ? '_real' : '';
        return $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).$typeadd."_avatar_$size.jpg";
}

?>
回复

使用道具 举报

 楼主| wujiaxi0428 发表于 2009-10-11 13:27:09 | 显示全部楼层
:P:P
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-13 02:50 , Processed in 0.115617 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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