From 58811fc84eccfc86f37099405e7fb09ce246b872 Mon Sep 17 00:00:00 2001 From: icicle198514 Date: Sun, 29 Sep 2024 16:11:43 +0800 Subject: [PATCH 1/4] Update Action.php --- Action.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Action.php b/Action.php index 57cb7a5..b7e48f0 100644 --- a/Action.php +++ b/Action.php @@ -16,6 +16,7 @@ public function insertLink() /** 过滤XSS */ $link['name'] = $this->request->filter('xss')->name; + $link['city'] = $this->request->filter('xss')->city; $link['sort'] = $this->request->filter('xss')->sort; $link['description'] = $this->request->filter('xss')->description; $link['user'] = $this->request->filter('xss')->user; From 8d63fdb98ef522c538c280c80fb39db29cce51f2 Mon Sep 17 00:00:00 2001 From: icicle198514 Date: Sun, 29 Sep 2024 16:12:28 +0800 Subject: [PATCH 2/4] Update Mysql.sql add city to mysql --- Mysql.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/Mysql.sql b/Mysql.sql index b5f4ee1..5488f7e 100644 --- a/Mysql.sql +++ b/Mysql.sql @@ -5,6 +5,7 @@ CREATE TABLE `typecho_links` ( `sort` varchar(50) DEFAULT NULL COMMENT 'links分类', `email` varchar(50) DEFAULT NULL COMMENT 'links邮箱', `image` varchar(200) DEFAULT NULL COMMENT 'links图片', + `city` varchar(200) DEFAULT NULL COMMENT 'links城市', `description` varchar(200) DEFAULT NULL COMMENT 'links描述', `user` varchar(200) DEFAULT NULL COMMENT '自定义', `state` int(10) DEFAULT '1' COMMENT 'links状态', From 9958f4a325464caba78c788dae158a616678d405 Mon Sep 17 00:00:00 2001 From: icicle198514 Date: Sun, 29 Sep 2024 16:13:18 +0800 Subject: [PATCH 3/4] Update Plugin.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 数据库增加城市选项,用户可根据城市定义标签云 * 调整了友链链接框报警server error 以http:// 或者 https:// 开头 --- Plugin.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Plugin.php b/Plugin.php index 85ba299..b859447 100644 --- a/Plugin.php +++ b/Plugin.php @@ -5,10 +5,14 @@ * * @package Links * @author 懵仙兔兔 - * @version 1.2.7 + * @version 1.2.8 * @dependence 14.10.10-* * @link https://2dph.com - * + * + * version 1.2.8 at 2024-09-29 by 小布丁 + * 数据库增加城市选项,用户可根据城市定义标签云 + * 调整了友链链接框报警server error 以http:// 或者 https:// 开头 + * * version 1.2.7 at 2024-06-21 by 泽泽社长 * 解决php8.2一处报错问题 * @@ -132,7 +136,7 @@ public static function config(Typecho_Widget_Helper_Form $form) echo '
  • - +

    @@ -200,6 +204,10 @@ public static function config(Typecho_Widget_Helper_Form $form) {image} ' . _t('友链图片') . ' + + + {city} + ' . _t('城市') . ' {size} @@ -290,7 +298,7 @@ public static function linksInstall() ('SQLite' == $type && ('HY000' == $code || 1 == $code)) ) { try { - $script = 'SELECT `lid`, `name`, `url`, `sort`, `email`, `image`, `description`, `user`, `state`, `order` from `' . $prefix . 'links`'; + $script = 'SELECT `lid`, `name`, `url`, `sort`, `email`, `image`, `city`, `description`, `user`, `state`, `order` from `' . $prefix . 'links`'; $installDb->query($script, Typecho_Db::READ); return _t('检测到友情链接数据表,友情链接插件启用成功'); } catch (Typecho_Db_Exception $e) { @@ -345,7 +353,7 @@ public static function form($action = null) $form->addInput($name); /** 友链地址 */ - $url = new Typecho_Widget_Helper_Form_Element_Text('url', null, "http://", _t('友链地址*')); + $url = new Typecho_Widget_Helper_Form_Element_Text('url', null, null, _t('友链地址*'),_t('需要以http://或https://开头.')); $form->addInput($url); /** 友链分类 */ @@ -359,6 +367,10 @@ public static function form($action = null) /** 友链图片 */ $image = new Typecho_Widget_Helper_Form_Element_Text('image', null, null, _t('友链图片'), _t('需要以http://或https://开头,留空表示没有友链图片')); $form->addInput($image); + + /** 友链城市 */ + $city = new Typecho_Widget_Helper_Form_Element_Text('city', null, null, _t('友链城市'), _t('填写友链城市')); + $form->addInput($city); /** 友链描述 */ $description = new Typecho_Widget_Helper_Form_Element_Textarea('description', null, null, _t('友链描述')); @@ -387,6 +399,7 @@ public static function form($action = null) $form->addItem($submit); $request = Typecho_Request::getInstance(); + if (isset($request->lid) && 'insert' != $action) { /** 更新模式 */ $db = Typecho_Db::get(); @@ -401,6 +414,7 @@ public static function form($action = null) $sort->value($link['sort']); $email->value($link['email']); $image->value($link['image']); + $city->value($link['city']); $description->value($link['description']); $user->value($link['user']); $state->value($link['state']); @@ -430,6 +444,7 @@ public static function form($action = null) $sort->addRule('maxLength', _t('友链分类最多包含50个字符'), 50); $email->addRule('maxLength', _t('友链邮箱最多包含50个字符'), 50); $image->addRule('maxLength', _t('友链图片最多包含200个字符'), 200); + $city->addRule('maxLength', _t('友链城市最多包含200个字符'), 200); $description->addRule('maxLength', _t('友链描述最多包含200个字符'), 200); $user->addRule('maxLength', _t('自定义数据最多包含200个字符'), 200); } @@ -494,8 +509,8 @@ public static function output_str($widget, array $params) } if ($link['state'] == 1) { $str .= str_replace( - array('{lid}', '{name}', '{url}', '{sort}', '{title}', '{description}', '{image}', '{user}', '{size}'), - array($link['lid'], $link['name'], $link['url'], $link['sort'], $link['description'], $link['description'], $link['image'], $link['user'], $size), + array('{lid}', '{name}', '{url}', '{sort}', '{title}', '{description}', '{image}', '{city}', '{user}', '{size}'), + array($link['lid'], $link['name'], $link['url'], $link['sort'], $link['description'], $link['description'], $link['image'], $link['city'], $link['user'], $size), $pattern ); } From a1b4406bea6d36b76e207e238c15a131676d8704 Mon Sep 17 00:00:00 2001 From: icicle198514 Date: Sun, 29 Sep 2024 16:14:00 +0800 Subject: [PATCH 4/4] Update manage-links.php --- manage-links.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manage-links.php b/manage-links.php index 9f5909a..07d4ac4 100644 --- a/manage-links.php +++ b/manage-links.php @@ -60,6 +60,7 @@ + @@ -69,6 +70,7 @@ + @@ -89,6 +91,7 @@ echo 'NOPIC'; } ?> + lid)): ?> - $('.typecho-mini-panel').effect('highlight', '#AACB36'); + $('.typecho-mini-panel').effect('highlight', '#aacb36'); }); })(); + +