summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorouttime <i@timewk.cn>2019-12-20 09:45:34 +0800
committerouttime <i@timewk.cn>2019-12-20 09:45:34 +0800
commitf145340482111518f91e0ffce7fb2ea1b4964ef5 (patch)
tree1916d110f4282b4b42599d85af850abdcd6942e7
parent47d59395cdc631fed379b8dd638f54861c6627ed (diff)
🤮Fix:修复文章页加载图片无法显示的问题
-rw-r--r--libs/Contents.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/Contents.php b/libs/Contents.php
index 7904603..fc8c90b 100644
--- a/libs/Contents.php
+++ b/libs/Contents.php
@@ -13,6 +13,10 @@ class Contents
*/
static public function parseContent($data, $widget, $last)
{
+ $db=Typecho_Db::get();
+ $load_image = $db->fetchAll($db->select('value')->from('table.options')->where('name = %s', "theme:Miracles")->limit(1));
+ $load_image = explode("\";",explode("\"",explode("\"loading_image\";",$load_image[0]["value"],2)[1],2)[1],2)[0];
+ //由于实在没找到TE获取主题配置的相关函数,故只能用这种方法,吐了。
$text = empty($last) ? $data : $last;
if ($widget instanceof Widget_Archive) {
//Prism 高亮
@@ -20,7 +24,7 @@ class Contents
//FancyBox
$text = preg_replace('/<img(.*?)src="(.*?)"(.*?)alt="(.*?)"(.*?)>/s','<center><a data-fancybox="gallery" href="${2}" class="gallery-link"><img${1}src="${2}"${3}></a></center>',$text);
//LazyLoad
- $text = preg_replace('/<img (.*?)src(.*?)(\/)?>/','<img $1src="/usr/themes/Miracles/images/loading/'.$this->options->loading_image.'.gif" data-original$2 />',$text);
+ $text = preg_replace('/<img (.*?)src(.*?)(\/)?>/','<img $1src="/usr/themes/Miracles/images/loading/'.$load_image.'.gif" data-original$2 />',$text);
//气泡
$text = preg_replace('/\[bubble\](.*?)\[\/bubble\]/s','<div class="bubble post-bubble"><div class="saying-content"><p>${1}</p></div></div>',$text);