|
@@ -329,14 +329,18 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
|
// 将原来的MP4链接替换为视频播放器
|
|
|
$answer = str_replace($mp4url, $videoPlayer, $answer);
|
|
|
}
|
|
|
-
|
|
|
- //暂进屏蔽POSTCONTENT
|
|
|
- // if($postContent)
|
|
|
- // {
|
|
|
-
|
|
|
- // $answer=$postContent['text'];
|
|
|
-
|
|
|
- // }
|
|
|
+
|
|
|
+ // 检查答案中是否包含.jpg、.jpeg、.png、.gif等图片链接
|
|
|
+ if (!empty($answer)) {
|
|
|
+ // 匹配图片链接,包括osscdn.mietubl.com和mietublcom.oss两种域名
|
|
|
+ if (preg_match_all('/(https:\/\/(?:osscdn\.mietubl\.com|mietublcom\.oss)[^\s]+\.(?:jpg|jpeg|png|gif|webp))/i', $answer, $imgMatches)) {
|
|
|
+ foreach ($imgMatches[1] as $imgUrl) {
|
|
|
+ // 将图片链接替换为img标签
|
|
|
+ $imgTag = '<div class="adress"><img src="' . $imgUrl . '" alt="' . $question . '" style="max-width:100%; height:auto;"></div>';
|
|
|
+ $answer = str_replace($imgUrl, $imgTag, $answer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -347,7 +351,7 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
|
<div class="uk-card uk-card-category uk-card-default uk-card-hover uk-card-body uk-inline uk-border-rounded uk-width-1-1">
|
|
|
<div class="question" onclick="toggleAnswer(<?= $index ?>)">
|
|
|
<h4><?= "$index. $question" ?> </h4>
|
|
|
-<!-- <span id="icon---><?php //= $index ?><!--" class="toggle-icon">▼</span>-->
|
|
|
+
|
|
|
|
|
|
</div>
|
|
|
<div id="answer-<?= $index ?>" class="answer" style="display: none;white-space: pre-line;">
|
|
@@ -494,6 +498,18 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
|
// 将原来的MP4链接替换为视频播放器
|
|
|
$answer = str_replace($mp4url, $videoPlayer, $answer);
|
|
|
}
|
|
|
+
|
|
|
+ // 检查答案中是否包含.jpg、.jpeg、.png、.gif等图片链接
|
|
|
+ if (!empty($answer)) {
|
|
|
+ // 匹配图片链接,包括osscdn.mietubl.com和mietublcom.oss两种域名
|
|
|
+ if (preg_match_all('/(https:\/\/(?:osscdn\.mietubl\.com|mietublcom\.oss)[^\s]+\.(?:jpg|jpeg|png|gif|webp))/i', $answer, $imgMatches)) {
|
|
|
+ foreach ($imgMatches[1] as $imgUrl) {
|
|
|
+ // 将图片链接替换为img标签
|
|
|
+ $imgTag = '<div class="adress"><img src="' . $imgUrl . '" alt="' . $question . '" style="max-width:100%; height:auto;"></div>';
|
|
|
+ $answer = str_replace($imgUrl, $imgTag, $answer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//暂进屏蔽POSTCONTENT
|
|
|
// if($postContent)
|
|
@@ -512,7 +528,7 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
|
<div class="uk-card uk-card-category uk-card-default uk-card-hover uk-card-body uk-inline uk-border-rounded uk-width-1-1">
|
|
|
<div class="question" onclick="toggleAnswer(<?= $index ?>)">
|
|
|
<h4><?= "$index. $question" ?> </h4>
|
|
|
- <!-- <span id="icon---><?php //= $index ?><!--" class="toggle-icon">▼</span>-->
|
|
|
+
|
|
|
|
|
|
</div>
|
|
|
<div id="answer-<?= $index ?>" class="answer" style="display: none;white-space: pre-line;">
|
|
@@ -550,46 +566,13 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
|
}
|
|
|
?>
|
|
|
|
|
|
- <?php if ($search&&$this->have()): ?>
|
|
|
- <?php while($this->next()): ?>
|
|
|
-
|
|
|
- <div class="uk-card uk-card-category uk-card-default uk-card-hover uk-card-body uk-inline uk-border-rounded uk-width-1-1">
|
|
|
- <a class="uk-position-cover" href="<?php $this->permalink() ?>"></a>
|
|
|
- <h3 class="uk-card-title uk-margin-remove uk-text-secondary uk-article-titles"><?php echo $this->title; ?></h3>
|
|
|
- <p class="uk-margin-small-top"><?php if($this->fields->excerpt):?><?php echo $this->fields->excerpt;?><?php else:?><?php echo General::cutexpert($this->excerpt,100);?><?php endif; ?></p>
|
|
|
-<!-- <div class="uk-article-meta uk-flex uk-flex-middle">-->
|
|
|
-<!-- <img class="uk-border-circle uk-avatar-small" src="--><?php //echo General::getAvatar($this->author->mail); ?><!--">-->
|
|
|
-<!-- <div>-->
|
|
|
-<!-- --><?php //$this->author->screenName();?><!-- Write <br>-->
|
|
|
-<!-- <time class="uk-margin-small-right" datetime="--><?php //$this->date('Y-m-d H:i:s'); ?><!--">Post --><?php //$this->date('Y-m-d H:i:s'); ?><!--</time><br>-->
|
|
|
-<!-- -->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
- </div>
|
|
|
- <?php endwhile;?>
|
|
|
- <?php else:?>
|
|
|
-
|
|
|
- <?php endif;?>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
-<?php
|
|
|
-// ob_start();
|
|
|
-// $this->pageNav('«','»', 1, '');
|
|
|
-// $content = ob_get_contents();
|
|
|
-// ob_end_clean();
|
|
|
-// $content = preg_replace("/<ol class=\"(.*?)\">/sm", '<ul class="uk-pagination uk-flex-center uk-margin-medium-top" uk-margin>', $content);
|
|
|
-// $content = preg_replace("/<li><span>(.*?)<\/span><\/li>/sm", '<li class="uk-disabled"><span>…</span></li>', $content);
|
|
|
-// $content = preg_replace("/<li class=\"current\"><a href=\"(.*?)\">(.*?)<\/a><\/li>/sm", '<li class="uk-active"><span>$2</span></li>', $content);
|
|
|
-// $content = preg_replace("/<li><a href=\"(.*?)\">(.*?)<\/a><\/li>/sm", '<li><a href="$1">$2</a></li>', $content);
|
|
|
-// $content = preg_replace("/<li [class=\"prev\"]+><a href=\"(.*?)\">(.*?)<\/a><\/li>/sm", '<li><a href="$1"><span uk-pagination-previous></span></a></li>', $content);
|
|
|
-// $content = preg_replace("/<li [class=\"next\"]+><a href=\"(.*?)\">(.*?)<\/a><\/li>/sm", '<li><a href="$1"><span uk-pagination-next></span></a></li>', $content);
|
|
|
-// $content = preg_replace("/<\/ol>/sm", '</ul>', $content);
|
|
|
-// echo $content;
|
|
|
-// ?>
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
|