本帖最后由 sybgood 于 2010-3-26 09:55 编辑
刚用HOME2.0发现每天都会收到很多打招呼,我给他回复后,朋友也收到打招呼就又回复了,分不出哪些是新收到的招呼和回复的招呼,出现一个招呼过程来回打的死循环现象,搞的很累,很烦人啊!于是就自己改了下程序,小动下数据库就OK了!先给大家分享!:)
修改方法如下:
1.给uchome_poke表增加字段huifu:0-新招呼,1-回复招呼
2.在cp_poke.php中修改
//打招呼
if(submitcheck('pokesubmit')) {
if($op == 'reply') {
$huifu=1;
}else{
$huifu=0;
}
$setarr = array(
'uid' => $uid,
'fromuid' => $_SGLOBAL['supe_uid'],
'fromusername' => $_SGLOBAL['supe_username'],
'note' => getstr($_POST['note'], 50, 1, 1),
'dateline' => $_SGLOBAL['timestamp'],
'iconid' => intval($_POST['iconid']),
'huifu' => $huifu
);
3.修改cp_poke.htm中
<div style="padding:10px 0 10px 0;">
<!--{if !$value['huifu']}--><a href="cp.php?ac=poke&op=reply&uid=$value[uid]" id="a_p_r_$value[uid]" onclick="ajaxmenu(event, this.id, 1)" class="submit">回打招呼</a> <!--{/if}-->
<!--{if !$value['isfriend']}--><a href="cp.php?ac=friend&op=add&uid=$value[uid]" id="a_friend_$key" onclick="ajaxmenu(event, this.id, 1)" class="submit">加为好友</a> <!--{/if}-->
</div> |