|
演示网址:http://bbs.laxjyj.com/profile.php?u=18
适合版本:PW3.X
需要修改的文件:profile.php、showuserdb.htm、favor.htm、profile.htm,请根据需要决定是否安装。
修正:上传的代码因为没有关闭“自动分析url”造成源代码一些地方自动加上url标签,现已修正。
修改步骤:
1、论坛根目录:profile.php,找
if (empty($action)) $action='modify';
替换为:
if (empty($action)){//仿PW4.3的控制面板首页 for pw3.0 by http://bbs.laxjyj.com
require_once('./header.php');
require_once(R_P.'data/bbscache/bk_config.php');
$sql="m.uid='$winddb[uid]'";
$userdb = $db->get_one("SELECT m.*,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.lastvisit,md.thisvisit,md.onlinetime,md.lastpost,md.todaypost,md.onlineip FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE $sql");
$bankdb=$db->get_one("SELECT deposit,startdate,ddeposit,dstartdate FROM pw_memberinfo WHERE uid='$winduid'");
if(!$bankdb){
$bankdb['deposit']=$bankdb['ddeposit']=$bankdb['startdate']=0;
}
if($bankdb['startdate'] && $timestamp>$bankdb['startdate']){
$accrual=round((floor(($timestamp-$bankdb['startdate'])/86400))*$bankdb['deposit']*$bk_rate/100);//银行利息
} else{
$accrual=0;
}
$credit=$db->query("SELECT m.value,c.name,c.description FROM pw_membercredit m LEFT JOIN pw_credits c ON c.cid=m.cid WHERE uid='$userdb[uid]'");
if(!$userdb) {
$errorname='';
Showmsg('user_not_exists');
} else{
$userdb['rvrc']=floor($userdb['rvrc']/10);
}
if ($userdb['site'] && strpos($userdb['site'],"://")==false){
$userdb['site']="http://$userdb[site]";
}
if($userdb['groupid']=='-1'){
$systitle='';
} else{
$systitle=$ltitle[$userdb['groupid']];
}
isset($ltitle[$userdb['memberid']]) && $memtitle=$ltitle[$userdb['memberid']];
$usericon=showfacedesign($userdb['icon']);
$lasttime=get_date($userdb['lastvisit'],"Y-m-d");
$show_regdate=get_date($userdb['regdate'],"Y-m-d");
$tempintroduce=$userdb['introduce'];
if($userdb['onlinetime']){
$userdb['onlinetime']=floor($userdb['onlinetime']/3600);
} else{
$userdb['onlinetime']=0;
}
/////////收件箱
$msgdb=array();
$num=0;$readtype='read';
$query = $db->query("SELECT mid,fromuid,touid,username,ifnew,title,mdate FROM pw_msg WHERE type='rebox' AND touid='$winduid' ORDER BY mdate DESC LIMIT 5");//$winddb[uid]
while($msginfo=$db->fetch_array($query)){
$num++;
$msginfo['title']=substrs($msginfo['title'],35);
$msginfo['mdate']=get_date($msginfo['mdate']);
$msginfo['from']=$msginfo['username'];
$msginfo['to']=$windid;
$msgdb[]=$msginfo;
}
//收藏主题
include_once(R_P.'data/bbscache/forum_cache.php');
require R_P.'require/forum.php';
$favordb=array();
$favor=$db->get_one("SELECT tids FROM pw_favors WHERE uid='$winddb[uid]'");
if($favor['tids']){
$query=$db->query("SELECT t.fid,t.tid,t.subject,t.postdate,t.author,t.replies,t.hits FROM pw_threads t WHERE t.tid IN($favor[tids]) ORDER BY t.postdate DESC LIMIT 5");
while($favor=$db->fetch_array($query)){
$favor['postdate']=get_date($favor['postdate']);
$favor['forum']=$forum[$favor['fid']]['name'];
$favor['subject']=substrs($favor['subject'],35);
$favordb[]=$favor;
}
}
require_once(PrintEot('profile'));footer();
}
2、修改模板文件:
在showuserdb.htm、favor.htm、profile.htm中,将
<td width=25% class='f_one'>控制面板首页</td>
<td width=25% class='f_one'><a href='profile.php'>编辑个人资料</a></td>
改为:
<td width=25% class='f_one'><a href='profile.php'>控制面板首页</a></td>
<td width=25% class='f_one'><a href='profile.php?action=modify'>编辑个人资料</a></td>
3、在profile.htm中找到(9.23修正)
<form action='profile.php?' method=post onSubmit='return procheck(this)' name=creator enctype='multipart/form-data'>
替换为:
<!--
EOT;
if(!$action){
//仿PW4.3的控制面板首页 for pw3.0 by http://bbs.laxjyj.com
print <<<EOT
-->
<table width='$tablewidth' cellspacing=1 cellpadding=4 align=center>
<tr><td width='23%' valign="top">
<table width='100%' cellspacing=1 cellpadding=4 align=center $i_table>
<tr><td class="head" align="center"><b>用户头像</b></td></tr>
<tr><td class="f_one" align="center">$usericon<br><br>
<a href='search.php?authorid=$userdb[uid]'>[我的主题]</a>
<a href='search.php?authorid=$userdb[uid]&digest=1'>[我的精华帖]</a>
</td></tr>
<tr><td class="head" align="center"><b>基本信息</b></td></tr>
<tr><td class="f_one">
用户名: $windid
<!--
EOT;
if($userdb[honor]){print <<<EOT
-->
($userdb[honor])
<!--
EOT;
}print <<<EOT
-->
<br>
<!--
EOT;
if($systitle){print <<<EOT
-->
系统头衔: $systitle<br>
<!--
EOT;
}print <<<EOT
-->
会员头衔: $memtitle<br>
精华: $userdb[digests]<br>
发帖: $userdb[postnum]<br>
$db_rvrcname: $userrvrc $db_rvrcunit<br>
$db_creditname: $userdb[credit] $db_creditunit<br>
在线时间: $userdb[onlinetime] 小时<br>
注册时间: $show_regdate<br>
最后登录: $lasttime<br>
</td></tr>
<tr><td class="head" align="center"><b>个人财产</b></td></tr>
<tr><td class="f_one">
$db_moneyname: $winddb[money] $db_moneyunit<br>
活期存款: $bankdb[deposit] $db_moneyunit<br>
活期利息:$accrual $db_moneyunit<br>
定期存款: $bankdb[ddeposit] $db_moneyunit
</td></tr>
</table>
</td><td valign="top">
<table width='100%' cellspacing=1 cellpadding=4 align=center $i_table>
<tr><td class="head" colspan="6"><b>最新五条短消息</b></td></tr>
<tr class="cbg" align="center">
<td width="5%">ID</td>
<td width="35%">标题</td>
<td width="15%">发件人</td>
<td width="15%">收件人</td>
<td width="20%">时间</td>
<td width="5%">已读</td></tr>
<!--
EOT;
$id=0;
foreach($msgdb as $key => $value){
$id++;
print <<<EOT
-->
<tr class="f_one" align="center">
<td>$id</td>
<td><a href="message.php?action=read&mid=$value[mid]" target="_blank">$value[title]</a></td>
<td><a href="profile.php?action=show&uid=$value[fromuid]">$value[username]</a></td>
<td><a href="profile.php?action=show&uid=$value[touid]">$value[to]</a></td>
<td>$value[mdate]</td>
<td>
<!--
EOT;
if($value['ifnew']){print <<<EOT
-->
<font color=red>否</font>
<!--
EOT;
}else{print <<<EOT
-->
是
<!--
EOT;
}print <<<EOT
-->
</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table><br>
<table width='100%' cellspacing=1 cellpadding=4 align=center $i_table>
<tr><td class="head" colspan="5"><b>最新五个收藏主题</b></td></tr>
<tr class="cbg" align="center">
<td width="5%">ID</td>
<td width="35%">标题</td>
<td width="15%">论坛</td>
<td width="15%">作者</td>
<td width="25%">发表时间</td>
</tr>
<!--
EOT;
$id=0;
foreach($favordb as $key => $value){
$id++;
print <<<EOT
-->
<tr class="f_one" align="center">
<td>$id</td>
<td><a href="read.php?tid=$value[tid]" target="_blank">$value[subject]</a></td>
<td><a href="thread.php?fid=$value[fid]">$value[forum]</a></td>
<td><a href="profile.php?action=show&uid=$value[authorid]">$value[author]</a></td>
<td>$value[postdate]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--以下Google广告代码,主要为了给表格底部平整-->
<br>
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-4046253115544722";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
<!--上面为Google代码-->
</td></tr></table>
<!--
EOT;
//以上为仿PW4.3的控制面板首页 for pw3.0 by http://bbs.laxjyj.com
}elseif($action=='modify'){print <<<EOT
-->
<form action='profile.php?' method=post onSubmit='return procheck(this)' name=creator enctype='multipart/form-data'>
<input type="hidden" name="action" value="modify"><!--9.23增加,否则编辑个人资料不能保存-->
4、在profile.htm中找到
?>-->
改为:
}
?>-->
完成!
|