FreeDiscuz!'s Archiver

horseluke 发表于 2009-8-26 21:57

模拟Ucenter Server的avatar.php文件For Discuz! 6.1F

[b]功能说明:[/b]
标题已经说明了功能,主要满足某些需要显示用户头像但又不能直接调用discuz_uc_avatar函数的时候。
[b][color=Red]本php脚本支持显示设置了url外连头像或使用了论坛内置头像(插件地址:[url]http://www.freediscuz.net/bbs/thread-3845-1-1.html[/url])的用户,因此在多并发的情况下资源消耗将较大,因此请慎重使用。[/color][/b]

[b]使用方法:[/b]
把avatar.php放到Discuz! 6.1F论坛目录下。在需要的地方以如下方式调用:[code]avatar.php?uid=xxx&size=zzz&return=yyy[/code]其中uid为必须。
size可选'big', 'middle', 'small'(以上参数均不含单引号)或者不使用。默认返回big。
return可选'image','src','html'(以上参数均不含单引号)或者不使用。默认返回image(以header方式返回图像地址,推荐此方式,以减轻服务器负担),src为直接返回图像地址,html为返回带img html格式的图像代码。

[b]应用场景:[/b]
在某html插入如下代码[code]<img src="http://你的论坛地址/avatar.php?uid=1">[/code]即可显示uid为1的头像

============================================

  Copyright (c)2009 Horse Luke & 044003
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
       [url]http://www.apache.org/licenses/LICENSE-2.0[/url]

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

[[i] 本帖最后由 horseluke 于 2009-8-26 22:07 编辑 [/i]]

044003 发表于 2009-8-26 22:02

你的那麼垃圾的
我只用讀一次數據庫:$[attach]2246[/attach]

horseluke 发表于 2009-8-26 22:03

回复 2# 044003 的帖子

本代码为无聊之作:L
我都佩服自己写了那么多无聊的代码:L :L :L
而且把简单问题复杂化:Q :Q :Q

iamxyh 发表于 2009-9-8 21:44

适用于minispace吗?

horseluke 发表于 2009-9-8 22:52

回复 4# iamxyh 的帖子

看这个:[url]http://www.freediscuz.net/bbs/thread-4004-1-2.html[/url]

iamxyh 发表于 2009-9-8 23:11

是啊,我就是看了这个所以问的。。你在那里写到:
安装到dz6.1F后普遍问题是无法显示头像和无法发送短消息,现在给出较笨的修改方法(聪明的应该是搞个avatar.php调用)

我想知道是不是这里的avatar.php

horseluke 发表于 2009-9-8 23:48

回复 6# iamxyh 的帖子

实践后觉得6.1f用avatar.php用处不大,反而增加服务器负担
原帖的修改已经足够了。我去修改修改原帖

[[i] 本帖最后由 horseluke 于 2009-9-8 23:50 编辑 [/i]]

页: [1]

Powered by Discuz! Archiver 6.1.0F  © 2001-2007 Comsenz Inc.