$rt[$atype][$at['aid']] = $rat; } } } $diarydb[] = $rt; } } } elseif (is_numeric($did)) { if ($u != $winduid && $groupid != 3) { $sqladd .= " AND d.privacy!=2 AND d.did=" . pwEscape($did); } else { $sqladd .= " AND d.did=" . pwEscape($did); } $diary = $db->get_one("SELECT d.did,d.dtid,d.uid,d.aid,d.username,d.privacy,d.subject,d.content,d.ifconvert,d.ifwordsfb,d.r_num,d.c_num,d.postdate,d.ifcopy,d.copyurl,m.groupid FROM pw_diary d LEFT JOIN pw_members m ON d.uid=m.uid {$sqladd}"); !$diary && Showmsg('mode_o_no_diary'); if ($u != $winduid && $groupid != 3 && !getOneFriend($u) && $diary['privacy'] == 1) { Showmsg('diary_friend_right'); } $diary['r_num'] += 1; if ($diary['groupid'] == 6 && $db_shield && $groupid != 3) { $diary['subject'] = ''; $diary['content'] = appShield('ban_diary'); } $attachs = $aids = array(); if ($diary['aid']) { $attachs = unserialize($diary['aid']); if (is_array($attachs)) { $aids = attachment($diary['content']); } } $diary['content'] = str_replace("\n", "<br />", $diary['content']);
if ($u == $winduid) { Showmsg('friend_selferror'); } if ($u) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $toUserInfo = $userService->get($u); //username,userstatus $userstatus = $toUserInfo['userstatus']; $friendcheck = getstatus($userstatus, PW_USERSTATUS_CFGFRIEND, 3); if ($friendcheck == 2) { Showmsg('friend_not_add'); } elseif ($friendcheck == 1) { Showmsg('friend_add_check'); } if (getOneFriend($u)) { Showmsg('mode_o_is_friend'); } $pwSQL = array(); $pwSQL[] = array($winduid, $u, $timestamp, 0); $pwSQL[] = array($u, $winduid, $timestamp, 0); $db->update("REPLACE INTO pw_friends(uid,friendid,joindate,status) VALUES " . S::sqlMulti($pwSQL, false)); $userService->updatesByIncrement(array($winduid, $u), array(), array('f_num' => 1)); $myurl = $db_bbsurl . "/" . $baseUrl . "q=user&u=" . $winduid; M::sendNotice(array($toUserInfo['username']), array('title' => getLangInfo('writemsg', 'o_friend_success_title', array('username' => $windid)), 'content' => getLangInfo('writemsg', 'o_friend_success_cotent', array('uid' => $winduid, 'username' => $windid, 'myurl' => $myurl)))); //job sign $friendUserName = $toUserInfo['username']; initJob($winduid, "doAddFriend", array('user' => $friendUserName)); echo "success|"; ajax_footer(); } else {
$title = $temp['group']['name'] . "({$rt['link']})"; } elseif ($rt['type'] == 'diary') { $title = $temp['diary']['subject'] . "({$rt['link']})"; } elseif ($rt['type'] == 'topic') { $title = $temp['topic']['subject'] . "({$rt['link']})"; } else { $title = $rt['link']; } $descrip = $temp['descrip']; $atc_name = getLangInfo('app', $rt['type']); require_once PrintEot('m_ajax'); ajax_footer(); } } else { if ($u != $winduid) { $friend = getOneFriend($u); if ($friend || $groupid == 3) { $where .= 's.uid=' . pwEscape($u) . ' AND s.ifhidden=0'; $faceimg = $friend['face']; $username = $friend['username']; } else { Showmsg('mode_o_not_friend'); } //$thisbase .= "u=$u&"; } else { $where .= 's.uid=' . pwEscape($winduid) . ' AND s.ifhidden=0'; $username = $windid; } } $sum = $db->get_value("SELECT count(*) as sum FROM pw_share s WHERE {$where}"); if ($a == 'my') {