插件名称:用户头像插件 0.1 Alpha For LBS^2
发 布 人 :
星辉一冷 (版权所有)发布日期:2006-07-1
原始发布:
http://www.dreammx.com/xhyl/article.asp?id=311=========================
发布说明: 本插件尚在测试中,由于安装过程比较繁锁,建议您在安装之前,做好备份,否则一切损失与我无关。
效果截图:
修改教程:一、用ACCESS修改BLOG数据库,设计视图"blog_User"表,添加一个字段为:user_avatar,字段大小:50
二、在styles/下新建一个文件
引用来源: styles/common.css
.avatar
{
clear: none;
float: left;
margin: 5px;
width: 40px;
height: 40px;
}
/article.asp1.查找:
<%if(theUser.loggedIn&&(theUser.rights["delete"]>1||(theUser.rights["delete"]==1&&(theUser.id==theArticle.authorID||theUser.id==authorID)))){%>
<a href="comment.asp?act=delete&id=<%=id%>" title="<%=lang['delete']%>" confirm_delete_comment"]%>?')"><img src="<%=theCache.settings["imageFolder"]%>/icon_del.gif" alt="<%=lang['delete']%>" /></a>
<%}%>
2.在下面添加:
<%
var tUser =new lbsUser();
tUser.loadByID(authorID);
%>
<%if(tUser.avatar){%>
<img src="<%=func.HTMLEncodeLite(tUser.avatar)%>" alt="<%=author%>" class="avatar" />
<%}%>
/user.asp1.查找:
<tr>
<td class="formbox-rowheader" width="120"><%=lang["last_visit"]%>:</td>
<td class="formbox-content"><%=func.getDateTimeString("",tUser.lastVisit)%></td>
</tr>
2.在下面添加:
<%if(tUser.avatar){%>
<tr>
<td class="formbox-rowheader" width="120">Avatar:</td>
<td class="formbox-content"><img src="<%=func.HTMLEncodeLite(tUser.avatar)%>" alt="avatar" /></td>
</tr>
<%}%>
3.查找:
<tr>
<td class="formbox-rowheader"><%=lang["homepage"]%>:</td>
<td class="formbox-content"><input name="homepage" size="30" maxlength="50" type="text" value="<%=func.HTMLEncodeLite(tUser.homepage)%>" class="text" /></td>
</tr>
4.在下面添加:
<%if(tUser.avatar != undefined ) {%>
<tr>
<td class="formbox-rowheader">Avatar:</td>
<td class="formbox-content"><img src="<%=func.HTMLEncodeLite(tUser.avatar)%>" alt="Avatar" /></td>
</tr>
<%}%>
<%if(theUser.groupID==1 || theUser.groupID>2) {%>
<tr>
<td class="formbox-rowheader">AvatarURL:</td>
<td class="formbox-content"><input name="avatar" size="30" maxlength="50" type="text" value="<%=func.HTMLEncodeLite(tUser.avatar)%>" class="text" /></td>
</tr>
<%}%>
/class/user.asp1.查找:
this.gender;
this.email;
this.homepage;
2.在下面添加:
this.avatar;
3.查找:
this.email = arr["user_email"];
this.hideEmail = arr["user_hideemail"];
this.homepage = arr["user_homepage"];
4.下面添加:
this.avatar = arr["user_avatar"];
5.查找:
"user_gender": this.gender,
"user_Email": this.email,
"user_homepage": this.homepage,
6.下面添加:
"user_avatar": this.avatar,
/source/src_user.asp1.查找
// Let Admin change User's Group
if(theUser.groupID==1){
input["groupid"]=func.checkInt(input["groupid"]);
for(var i=0;i<theCache.userGroup.length;i++){
if(input["groupid"]==theCache.userGroup[i].id){
tUser.groupID=input["groupid"];
break;
}
}
}
2.下面添加:
// Check Avatar Permission
if(theUser.groupID==1 || theUser.groupID>2){
input["avatar"]=func.HTMLEncodeLite(input["avatar"]);
tUser.avatar=input["avatar"];
}
/global.asp1.查找
<link rel="stylesheet" type="text/css" href="<%=theCache.settings["styleSheet"]%>" />
2.下面添加
<link rel="stylesheet" type="text/css" href="styles/common.css" />
PS:本来没想到要发布的,因为我觉得做得还太烂,效率较低,但是我答应了老K(Kevin)会在我忙完之后发布出来。所以就只好将这个拿出来献丑了,希望各位高手看到后不要见笑。你可以随意修改并完善本插件,只要简单的注明原作者就行咯。 ^_^