{php} /** * Article detail content. */ $cid = $article['cid']; $ptpuser = $article['ptpuser']; $ptpimg = getUserAvatar($ptpuser); $isAnonymousPost = isFlag($article['is_anonymous'] ?? 0) === 1; $displayName = $isAnonymousPost ? '匿名用户' : getUserDisplayName($ptpuser); if ($isAnonymousPost) { $ptpimg = '/assets/img/tx.png'; } $ptptext = renderArticleEmojis(cleanArticleHtml($article['ptptext'] ?? '')); $ptpimag = $article['ptpimag'] ?? ''; $ptpvideo = $article['ptpvideo'] ?? ''; $ptpmusic = $article['ptpmusic'] ?? ''; $ptplx = $article['ptplx'] ?? 'only'; $ptpdw = $article['ptpdw'] ?? ''; $ptptime = $article['ptptime'] ?? ''; $ptpgg = $article['ptpgg'] ?? 0; $ptpggurl = $article['ptpggurl'] ?? ''; $ptpys = isFlag($article['ptpys'] ?? 1, 1); $commauth = isFlag($article['commauth'] ?? 1, 1); $tagsEnabled = \app\service\ContentFeatureService::tagsEnabled(); $tagList = $tagsEnabled ? array_values(array_filter(array_map('trim', explode(',', $article['tags'] ?? '')))) : []; $musicSource = ''; $videoParts = explode('|', $ptpvideo); $videoUrl = assetUrl($videoParts[0] ?? ''); $videoCover = assetUrl($videoParts[1] ?? ''); $images = $ptpimag === '' ? [] : array_values(array_filter(explode('(+@+)', $ptpimag), function ($value) { return trim((string)$value) !== ''; })); $imgCount = count($images); if ($imgCount === 1) { $gridStyle = 'grid-template-columns:1fr;width: 55%;'; } elseif ($imgCount === 2 || $imgCount === 4) { $gridStyle = 'grid-template-columns:1fr 1fr;width: 55%;'; } else { $gridStyle = 'grid-template-columns:1fr 1fr 1fr;'; } $adStyle = (isFlag($ptpgg ?? 0) === 1) ? 'display: flex;' : 'display: none;'; $adUrl = (isFlag($ptpgg ?? 0) === 1 && $ptpggurl !== '') ? '
' : ''; $gps = (isFlag($ptpgg ?? 0) === 1) ? '' : ''; $contentText = preg_replace('/{$displayName}
{php}$ptpggFlag = isFlag($ptpgg ?? 0);{/php} {if condition="$isPinned || $ptpggFlag === 1"}置顶
广告