- if($_G['group']['allowat']) {
- $atlist = $atlist_tmp = array();
- preg_match_all("/@([^\r\n]*?)\s/i", $message.' ', $atlist_tmp);
- $atlist_tmp = array_slice(array_unique($atlist_tmp[1]), 0, $_G['group']['allowat']);
- if(!empty($atlist_tmp)) {
- if(empty($_G['setting']['at_anyone'])) {
- foreach(C::t('home_follow')->fetch_all_by_uid_fusername($_G['uid'], $atlist_tmp) as $row) {
- $atlist[$row['followuid']] = $row['fusername'];
- }
- if(count($atlist) < $_G['group']['allowat']) {
- $query = C::t('home_friend')->fetch_all_by_uid_username($_G['uid'], $atlist_tmp);
- foreach($query as $row) {
- $atlist[$row['fuid']] = $row['fusername'];
- }
- }
- } else {
- foreach(C::t('common_member')->fetch_all_by_username($atlist_tmp) as $row) {
- $atlist[$row['uid']] = $row['username'];
- }
- }
- }
- if($atlist) {
- foreach($atlist as $atuid => $atusername) {
- $atsearch[] = "/@$atusername /i";
- $atreplace[] = "[url=home.php?mod=space&uid=$atuid]@{$atusername}[/url] ";
- }
- $message = preg_replace($atsearch, $atreplace, $message.' ', 1);
- }
- }
复制代码 @功能具体位置已经找到,晚上找点时间彻底分析一下看看到底是那里出现错误了 |