无心宠物帖子内显示(玫瑰花 版)for pw6.0

关键字描述:显示 宠物 帖子 < > read " height width

功能说明:
除了在个人资料显示宠物信息外,增加在论坛ID右侧显示玫瑰花数量,玫瑰花由宠物系统打怪获得,也可以在特殊商店或普通商店出售。会员打到或购买玫瑰花后赠送给谁,就显示在谁的用户名右侧。

效果演示:
见侠客站长论坛左侧(http://bbs.jb51.net),本人个人资料。

需要更改的文件:
read.php
template/wind/read.htm
(请务必先备份,以便出错后可以覆盖恢复)

一、read.php 文件
1、查找:
复制内容到剪贴板
代码:
$J_sql="LEFT JOIN $pw_tmsgs tm ON t.tid=tm.tid LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid";


在其下面添加

复制内容到剪贴板
代码:
$S_sql.=', pd.petname, pd.mypetpic, pd.pettype, pd.mypetjob, pd.mypetlevel, pd.mypetexp, pd.mypethp, pd.mypetmaxhp, pd.mypetsp, pd.mypetmp, pd.mypetmaxmp, pd.mypetgood, pd.mypetdead, pd.openpk, pr.nums, pr.fromuser';
$J_sql.=" LEFT JOIN pw_wxpetdata pd ON pd.username=m.username LEFT JOIN pw_wxrose pr ON pr.username=m.username";

2、查找:

复制内容到剪贴板
代码:
$query = $db->query("SELECT t.*,m.uid,m.username,m.gender,m.oicq,m.groupid,m.memberid,m.icon AS micon,m.hack,m.honor,m.signature,m.regdate,m.signchange,m.medals,m.showsign,m.payemail,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.thisvisit,md.lastvisit,md.onlinetime,md.starttime $fieldadd FROM $pw_posts t LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid $tablaadd WHERE t.tid='$tid' AND t.ifcheck='1' $sqladd ORDER BY $order LIMIT $start_limit, $readnum");


修改为:

复制内容到剪贴板
代码:
$query = $db->query("SELECT t.*,m.uid,m.username,m.gender,m.oicq,m.groupid,m.memberid,m.icon AS micon,m.hack,m.honor,m.signature,m.regdate,m.signchange,m.medals,m.showsign,m.payemail,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.thisvisit,md.lastvisit,md.onlinetime,md.starttime, pd.petname, pd.mypetpic, pd.pettype, pd.mypetjob, pd.mypetlevel, pd.mypetexp, pd.mypethp, pd.mypetmaxhp, pd.mypetsp, pd.mypetmp, pd.mypetmaxmp, pd.mypetgood, pd.mypetdead, pd.openpk, pr.nums, pr.fromuser $fieldadd FROM $pw_posts t LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid LEFT JOIN pw_wxpetdata pd ON pd.username=m.username LEFT JOIN pw_wxrose pr ON pr.username=m.username $tablaadd WHERE t.tid='$tid' AND t.ifcheck='1' $sqladd ORDER BY $order LIMIT $start_limit, $readnum");


关键字描述:显示 宠物 帖子 < > read " height width

3、查找:

复制内容到剪贴板
代码:
$anonymous=($read['anonymous'] && !$SYSTEM['viewhide'] && !$admincheck && $winduid!=$read['authorid']) ? 1 : 0;


在其下面加入

复制内容到剪贴板
代码:
//宠物数据>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if($read['petname']!=''){
if ($read['openpk'] == 0) {
$read['pk'] = "<font color=gray>躲在家里</font>";
}else{
$read['pk'] = "<a href=http://www.cppcns.com/cms/phpwind/pet.php?index=petbattle&atkname=$read[username]&action=askpk>接受挑战";
}
$petjob = $read['mypetjob'];
$petlevel= $read['mypetlevel'];
$levelpic = ($petlevel/10)>11?11:intval($petlevel/10);
if ($petjob == 0 or ($petjob <=3 && $petlevel < 200) or $read['mypetpic']=='') {
$read['petpic'] = "<img src=http://www.cppcns.com/cms/phpwind/wxpet/images/pet/$read[pettype]/$read[pettype]$levelpic.gif border=0>";
} else {
$read['petpic'] = "<img src=http://www.cppcns.com/cms/phpwind/$read[mypetpic] border=0>";
}

$petlevelfloor = pow (log10 (ceil($read['mypetexp']/ ($petjob * 0.2 1))), 3);
$epf=intval (100 * ($petlevelfloor - intval ($petlevelfloor)));
$hpf = floor (100 * ($read['mypethp'] / $read['mypetmaxhp']));
$mpf = $read['mypetmaxmp']?(floor (100 * ($read['mypetmp'] / $read['mypetmaxmp']))):0;
$spf = floor (100 * ($read['mypetsp'] / 5000)) - 1;
$read['epf']=$epf>97?97:$epf;
$read['hpf']=$hpf>97?97:$hpf;
$read['mpf']=$mpf>97?97:$mpf;

无心宠物帖子内显示(玫瑰花 版)for pw6.0

扫一扫手机访问