$isTucool = $forumset['iftucool'] && getstatus($read['tpcstatus'], 5); $ptable = $read['ptable']; $ifhide = $read['ifhide'] && !ifpost($tid) ? 1 : 0; $isAllowViewPic = $admincheck || $read['authorid'] == $winduid || !$ifhide && ($winduid || !$forumset['viewpic']); (!$isTucool || !$isAllowViewPic) && ObHeader("read.php?tid={$tid}&ds=1"); //禁言、屏蔽 $userService = L::loadClass('UserService', 'user'); $userInfo = $userService->get($read['authorid'], true, false, false); $ifshieldThread = ($read['ifshield'] || $userInfo['groupid'] == 6 && $db_shield) && !$isGM ? 0 : 1; !$ifshieldThread && ObHeader("read.php?tid={$tid}&ds=1"); $attachsService = L::loadClass('Attachs', 'forum'); $tucoolAttachs = $attachsService->getByTidAndUid($tid, $read['authorid']); !$tucoolAttachs && ObHeader("read.php?tid={$tid}&ds=1"); if ($read['aid']) { $attachShow = new attachShow($isGM || $pwSystem['delattach'] || $read['authorid'] == $winduid, $forumset['uploadset'], $forumset['viewpic']); $attachShow->setData($tucoolAttachs); $tucoolAttachs = buildTucoolAttachs($tucoolAttachs); $contentAids = $attachShow->findPicAids($read['content']); $read['content'] = convert($read['content'], $db_windpost); if (strrpos($read['content'], 'attachment') !== false) { $haveAids = $attachShow->findPicAids($read['content']); } } $tmpKeyArray = array_diff(array_keys($tucoolAttachs), (array) $contentAids); $tmpArray = array(); foreach ((array) $tmpKeyArray as $v) { $tmpArray[$v] = $tucoolAttachs[$v]; } $contentAttachs = array(); if (S::isArray($haveAids)) { foreach ($tucoolAttachs as $k => $v) {
/** * 处理日志附件、内容图片 * * @param $aid 日志里附件存储数据,unserialize格式类型 aid * @param $content 日志内容 * @param $authorid 日志作者 */ function _getAttachs($aid, &$content, $authorid) { global $winduid, $isGM; if (!$aid || !($attachs = unserialize($aid)) || !is_array($attachs)) { return array(); } $GLOBALS += L::style(); require_once R_P . 'require/bbscode.php'; $attachShow = new attachShow($isGM, '', false, 'diary'); $attachShow->setData($attachs); return $attachShow->parseAttachs('tpc', $content, $winduid == $authorid); }
$rt['postdate'] = get_date($rt['postdate']); $rt['content'] = str_replace("\n", "<br>", $rt['content']); $rt['ifconvert'] == 2 && ($rt['content'] = convert($rt['content'], $db_windpost)); foreach ($alarm as $key => $value) { $rt['content'] = str_replace($key, '<span style="background-color:#ffff66">' . $key . '</span>', $rt['content']); } $postdb[$rt['pid']] = $rt; if ($rt['aid']) { $tids[] = $rt['tid']; } } if ($tids) { $pw_attachs = L::loadDB('attachs', 'forum'); $attachs = $pw_attachs->gets(array('tid' => $tids, 'pid' => array_keys($postdb))); $attachShow = new attachShow(true); $attachShow->setData($attachs); foreach ($postdb as $key => $rt) { if (!$rt['aid']) { continue; } $rt += $attachShow->parseAttachs($rt['pid'], $rt['content'], 0); if ($rt['pic']) { foreach ($rt['pic'] as $k => $v) { $rt['content'] .= '<br />' . $v['img']; } } if ($rt['downattach']) { foreach ($rt['downattach'] as $k => $v) { $rt['content'] .= "<br />附件:<a href=\"job.php?action=download&aid={$v['aid']}\" onclick=\"return ajaxurl(this);\"> <font color=\"red\">{$v['name']}</font></a> ({$v['size']} K)"; } }
extract(L::style()); $leaveword = $atcdb['leaveword'] ? leaveword($atcdb['leaveword']) : ''; $content = convert($postdata->data['content'] . $leaveword, $db_windpost); if (strpos($content, '[p:') !== false || strpos($content, '[s:') !== false) { $content = showface($content); } if ($atcdb['ifsign'] < 2) { $content = str_replace("\n", '<br />', $content); } if ($postdata->data['ifwordsfb'] == 0) { $content = addslashes(wordsConvert(stripslashes($content))); } $creditnames = pwCreditNames(); if ($atcdb['attachs']) { $attachShow = new attachShow($pwpost->isGM || pwRights($pwpost->isBM, 'delattach'), $pwforum->forumset['uploadset']); $attachShow->setData($atcdb['attachs']); $attachShow->parseAttachs($pid, $content, $winduid == $atcdb['authorid']); } $alterinfo && ($content .= "<div id=\"alert_{$pid}\" style=\"color:gray;margin-top:30px\">[ {$alterinfo} ]</div>"); $atcdb['icon'] = $atcdb['icon'] ? "<img src=\"{$imgpath}/post/emotion/{$atcdb['icon']}.gif\" align=\"left\" border=\"0\" />" : ''; if (!$postdata->getIfcheck()) { if ($postdata->filter->filter_weight == 2) { $banword = implode(',', $postdata->filter->filter_word); $pinfo = 'post_word_check'; } elseif ($postdata->linkCheckStrategy) { $pinfo = 'post_link_check'; } $pinfo && Showmsg($pinfo); } echo "success\t" . stripslashes($atcdb['icon'] . " " . $atc_title) . "\t" . str_replace(array("\r", "\t"), array("", ""), stripslashes($content)); ajax_footer();