Skip to content

Commit

Permalink
兼容1.2开发版本,修复构建索引错误
Browse files Browse the repository at this point in the history
  • Loading branch information
kaygb committed Feb 16, 2022
1 parent 79f14f2 commit b3aa937
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Plugin.php
Expand Up @@ -11,7 +11,7 @@
* @version 0.1
* @link https://www.imalan.cn
*/

use Typecho\Widget;// 兼容1.2开发版
class ExSearch_Plugin implements Typecho_Plugin_Interface
{
/**
Expand Down Expand Up @@ -270,11 +270,12 @@ private static function widget($table, $pkId)
'Metas' => 'mid',
'Users' => 'uid'
);
$className = "Widget_Abstract_{$table}";
// $className = "Widget_Abstract_{$table}";
$className = "Widget_Abstract_".$table; // 兼容1.2开发版
$key = $keys[$table];
$db = Typecho_Db::get();
$widget = new $className(Typecho_Request::getInstance(), Typecho_Widget_Helper_Empty::getInstance());

// $widget = new $className(Typecho_Request::getInstance(), Typecho_Widget_Helper_Empty::getInstance());
$widget = Widget::widget($className);// 兼容1.2开发版
$db->fetchRow(
$widget->select()->where("{$key} = ?", $pkId)->limit(1),
array($widget, 'push'));
Expand Down Expand Up @@ -331,4 +332,4 @@ public static function footer()
<script src="<?php Helper::options()->pluginUrl('ExSearch/assets/ExSearch-6e577ac4e0.js'); ?>"></script>
<?php
}
}
}

0 comments on commit b3aa937

Please sign in to comment.