|
@@ -341,6 +341,21 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 将普通链接转换为可点击的链接(排除已经处理过的图片和视频链接)
|
|
|
|
+ if (!empty($answer)) {
|
|
|
|
+ // 匹配普通链接,排除已经在HTML标签中的链接
|
|
|
|
+ $pattern = '/(?<!["\'=])(?<!src=)(?<!href=)(https?:\/\/(?!(?:osscdn\.mietubl\.com|mietublcom\.oss)[^\s]+\.(?:jpg|jpeg|png|gif|webp|mp4))[^\s"\'<>]+)/i';
|
|
|
|
+ if (preg_match_all($pattern, $answer, $urlMatches)) {
|
|
|
|
+ foreach ($urlMatches[1] as $url) {
|
|
|
|
+ // 防止处理已经在a标签中的链接
|
|
|
|
+ if (strpos($answer, '<a') === false || strpos($answer, $url) < strpos($answer, '<a') || strpos($answer, $url) > strpos($answer, '</a>')) {
|
|
|
|
+ $linkTag = '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">' . $url . '</a>';
|
|
|
|
+ $answer = str_replace($url, $linkTag, $answer);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -367,9 +382,9 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
<button class="feedback-btn feedback-btn-<?= $index ?> not-helpful-btn" onclick="recordFeedback(<?= $index ?>, '<?= htmlspecialchars(addslashes($question), ENT_QUOTES, 'UTF-8') ?>', 0)" title="NO">
|
|
<button class="feedback-btn feedback-btn-<?= $index ?> not-helpful-btn" onclick="recordFeedback(<?= $index ?>, '<?= htmlspecialchars(addslashes($question), ENT_QUOTES, 'UTF-8') ?>', 0)" title="NO">
|
|
<i class="ri-thumb-down-line"></i>
|
|
<i class="ri-thumb-down-line"></i>
|
|
</button>
|
|
</button>
|
|
- <button onclick="window.open('https://wa.me/8617000161888?text=Hello!', '_blank')" class="feedback-btn" title="No result ? Contact us on WhatsApp." >
|
|
|
|
|
|
+ <button onclick="window.open('https://wa.me/8617000161888?text=Hello!', '_blank')" class="feedback-btn" title="No result ? Talk to us online." >
|
|
<i class="ri-whatsapp-line"></i>
|
|
<i class="ri-whatsapp-line"></i>
|
|
- feedback
|
|
|
|
|
|
+ Talk to us online
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div id="feedback-result-<?= $index ?>" class="feedback-result" style="display: none; color: #666; margin-top: 5px;"></div>
|
|
<div id="feedback-result-<?= $index ?>" class="feedback-result" style="display: none; color: #666; margin-top: 5px;"></div>
|
|
@@ -510,6 +525,21 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 将普通链接转换为可点击的链接(排除已经处理过的图片和视频链接)
|
|
|
|
+ if (!empty($answer)) {
|
|
|
|
+ // 匹配普通链接,排除已经在HTML标签中的链接
|
|
|
|
+ $pattern = '/(?<!["\'=])(?<!src=)(?<!href=)(https?:\/\/(?!(?:osscdn\.mietubl\.com|mietublcom\.oss)[^\s]+\.(?:jpg|jpeg|png|gif|webp|mp4))[^\s"\'<>]+)/i';
|
|
|
|
+ if (preg_match_all($pattern, $answer, $urlMatches)) {
|
|
|
|
+ foreach ($urlMatches[1] as $url) {
|
|
|
|
+ // 防止处理已经在a标签中的链接
|
|
|
|
+ if (strpos($answer, '<a') === false || strpos($answer, $url) < strpos($answer, '<a') || strpos($answer, $url) > strpos($answer, '</a>')) {
|
|
|
|
+ $linkTag = '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">' . $url . '</a>';
|
|
|
|
+ $answer = str_replace($url, $linkTag, $answer);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
//暂进屏蔽POSTCONTENT
|
|
//暂进屏蔽POSTCONTENT
|
|
// if($postContent)
|
|
// if($postContent)
|
|
@@ -544,9 +574,9 @@ if (!empty($keyword)&&(strpos($PathInfo, '/search') === 0))
|
|
<button class="feedback-btn feedback-btn-<?= $index ?> not-helpful-btn" onclick="recordFeedback(<?= $index ?>, '<?= htmlspecialchars(addslashes($question), ENT_QUOTES, 'UTF-8') ?>', 0)" title="NO">
|
|
<button class="feedback-btn feedback-btn-<?= $index ?> not-helpful-btn" onclick="recordFeedback(<?= $index ?>, '<?= htmlspecialchars(addslashes($question), ENT_QUOTES, 'UTF-8') ?>', 0)" title="NO">
|
|
<i class="ri-thumb-down-line"></i>
|
|
<i class="ri-thumb-down-line"></i>
|
|
</button>
|
|
</button>
|
|
- <button onclick="window.open('https://wa.me/8617000161888?text=Hello!', '_blank')" class="feedback-btn" title="No result ? Contact us on WhatsApp." >
|
|
|
|
|
|
+ <button onclick="window.open('https://wa.me/8617000161888?text=Hello!', '_blank')" class="feedback-btn" title="No result ? Talk to us online." >
|
|
<i class="ri-whatsapp-line"></i>
|
|
<i class="ri-whatsapp-line"></i>
|
|
- feedback
|
|
|
|
|
|
+ Talk to us online
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div id="feedback-result-<?= $index ?>" class="feedback-result" style="display: none; color: #666; margin-top: 5px;"></div>
|
|
<div id="feedback-result-<?= $index ?>" class="feedback-result" style="display: none; color: #666; margin-top: 5px;"></div>
|