给好友列表中我的好友增加备注名及提供备注名修改功能,如QQ的好友备注一样。修改代码如下:
1.给uchome_friend增加字段bzm
2.在space_friend.php中第159行 $query = $_SGLOBAL['db']->query("SELECT s.*,
f.resideprovince, f.residecity, f.note, f.spacenote, f.sex, main.gid, main.bzm, main.num增加main.bzm
3.在space_friend.htm中170行处即
<!--{else}-->
<a href="cp.php?ac=friend&op=changegroup&uid=$value[uid]"
id="friend_group_$value[uid]" onclick="ajaxmenu(event, this.id)">分组</a><span class="pipe">|</span>
<a href="cp.php?ac=friend&op=ignore&uid=$value[uid]"
id="a_ignore_$key" onclick="ajaxmenu(event, this.id)">删除</a><span class="pipe">|</span>
<!--{/if}-->
后增加代码:
<!--{if $value['bzm']}--><a href="cp.php?ac=friend&op=changebz&uid=$value[uid]" id="friendbz_$value
[uid]" onclick="ajaxmenu(event, this.id)">修改备注</a><!--{/if}-->
4.在cp_friend.htm中“<h1>好友热度</h1>”后增加代码:
<!--{elseif $op=='changebz'}-->
<h1>修改好友备注名</h1>
<a href="javascript:hideMenu();" class="float_del" title="关闭">关闭</a>
<div class="popupmenu_inner" id="__changebzform_{$uid}">
<form method="post" id="changebzform_{$uid}" name="changebzform_{$uid}" action="cp.php?
ac=friend&op=changebz&uid=$uid">
<p>修改好友备注名</p>
<p>
好友备注名:<input type="text" name="bzm" value="$friend[bzm]" >
</p>
<p class="btn_line">
<input type="hidden" name="refer" value="$_SGLOBAL[refer]">
<button name="changebzsubmit" type="submit" class="submit" value="true">确定</button>
</p>
<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
</form>
</div>
5.在cp_friend.php中 elseif($op == 'changenum')后增加代码:
elseif($op == 'changebz') {
if(submitcheck('changebzsubmit')) {
updatetable('friend', array('bzm'=>$_POST['bzm']), array('uid'=>$_SGLOBAL['supe_uid'],
'fuid'=>$uid));
friend_cache($_SGLOBAL['supe_uid']);
showmessage('do_success', $_SGLOBAL['refer'], 0);
}
//获得当前用户group
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('friend')." WHERE uid='$_SGLOBAL
[supe_uid]' AND fuid='$uid'");
if(!$friend = $_SGLOBAL['db']->fetch_array($query)) {
showmessage('specified_user_is_not_your_friend');
}
} |