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;
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状态',
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
);
}
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 '
';
}
?>
+ |
lid)): ?>
- $('.typecho-mini-panel').effect('highlight', '#AACB36');
+ $('.typecho-mini-panel').effect('highlight', '#aacb36');
});
})();
+
+
|