From 16c600038c4fe5bc60fd77480a44b838dcea9644 Mon Sep 17 00:00:00 2001 From: liyukun <1099438829@qq.com> Date: Mon, 6 Dec 2021 01:02:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=A4=A7=E6=B3=A2=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ape_blog.sql | 78 +++++- app/common/taglib/Ape.php | 64 +++-- app/index/common.php | 182 ++++++++------ app/index/config/view.php | 2 +- app/index/controller/Article.php | 2 +- .../default/pc/article/list_default.html | 233 +++++++----------- public/template/default/pc/public/header.html | 8 +- 7 files changed, 309 insertions(+), 260 deletions(-) diff --git a/ape_blog.sql b/ape_blog.sql index aa2ec58..21ad384 100644 --- a/ape_blog.sql +++ b/ape_blog.sql @@ -11,7 +11,7 @@ Target Server Version : 50726 File Encoding : 65001 - Date: 29/11/2021 00:59:17 + Date: 06/12/2021 01:02:01 */ SET NAMES utf8mb4; @@ -127,7 +127,7 @@ CREATE TABLE `ape_admin_log` ( `user_agent` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'User-Agent', `create_time` int(10) NOT NULL COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 133 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志表' ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 163 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of ape_admin_log @@ -264,6 +264,36 @@ INSERT INTO `ape_admin_log` VALUES (129, 1, 'admin', 'admin', 'system_config', ' INSERT INTO `ape_admin_log` VALUES (130, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.34', 1638117392); INSERT INTO `ape_admin_log` VALUES (131, 1, 'admin', 'admin', 'system_config', 'clearCache', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.34', 1638117581); INSERT INTO `ape_admin_log` VALUES (132, 1, 'admin', 'admin', 'system_config', 'clearCache', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.34', 1638118423); +INSERT INTO `ape_admin_log` VALUES (133, 1, 'admin', 'admin', 'login', 'login', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638631640); +INSERT INTO `ape_admin_log` VALUES (134, 1, 'admin', 'admin', 'index', 'main', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638631641); +INSERT INTO `ape_admin_log` VALUES (135, 1, 'admin', 'admin', 'article', 'index', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638631643); +INSERT INTO `ape_admin_log` VALUES (136, 1, 'admin', 'admin', 'category', 'index', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638632201); +INSERT INTO `ape_admin_log` VALUES (137, 1, 'admin', 'admin', 'system_config_tab', 'index', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638632243); +INSERT INTO `ape_admin_log` VALUES (138, 1, 'admin', 'admin', 'databases', 'index', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638632245); +INSERT INTO `ape_admin_log` VALUES (139, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638632245); +INSERT INTO `ape_admin_log` VALUES (140, 1, 'admin', 'admin', 'login', 'login', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638709143); +INSERT INTO `ape_admin_log` VALUES (141, 1, 'admin', 'admin', 'login', 'login', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638709184); +INSERT INTO `ape_admin_log` VALUES (142, 1, 'admin', 'admin', 'index', 'main', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638709185); +INSERT INTO `ape_admin_log` VALUES (143, 1, 'admin', 'admin', 'index', 'main', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710245); +INSERT INTO `ape_admin_log` VALUES (144, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710248); +INSERT INTO `ape_admin_log` VALUES (145, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710249); +INSERT INTO `ape_admin_log` VALUES (146, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710302); +INSERT INTO `ape_admin_log` VALUES (147, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710303); +INSERT INTO `ape_admin_log` VALUES (148, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710456); +INSERT INTO `ape_admin_log` VALUES (149, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710458); +INSERT INTO `ape_admin_log` VALUES (150, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710461); +INSERT INTO `ape_admin_log` VALUES (151, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710463); +INSERT INTO `ape_admin_log` VALUES (152, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710602); +INSERT INTO `ape_admin_log` VALUES (153, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710603); +INSERT INTO `ape_admin_log` VALUES (154, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710617); +INSERT INTO `ape_admin_log` VALUES (155, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710618); +INSERT INTO `ape_admin_log` VALUES (156, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710634); +INSERT INTO `ape_admin_log` VALUES (157, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710635); +INSERT INTO `ape_admin_log` VALUES (158, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710909); +INSERT INTO `ape_admin_log` VALUES (159, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710910); +INSERT INTO `ape_admin_log` VALUES (160, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710912); +INSERT INTO `ape_admin_log` VALUES (161, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710930); +INSERT INTO `ape_admin_log` VALUES (162, 1, 'admin', 'admin', 'system_config', 'base', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 1638710931); -- ---------------------------- -- Table structure for ape_admin_notify @@ -395,12 +425,13 @@ CREATE TABLE `ape_comment` ( `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态 1不显示 1显示', `update_time` int(11) NOT NULL COMMENT '评论时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = COMPACT; +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = COMPACT; -- ---------------------------- -- Records of ape_comment -- ---------------------------- -INSERT INTO `ape_comment` VALUES (1, '影子', 'qeqwe', 'eqw', '[f=youling]', 0, 0, 1636565743, 1, 0, 1638036039); +INSERT INTO `ape_comment` VALUES (1, '影子', 'qeqwe', 'eqw', '[f=youling]', 0, 0, 1636565743, 1, 1, 1638632235); +INSERT INTO `ape_comment` VALUES (2, 'AS', 'as', 'AS', 'aasSa', 0, 0, 1638631598, 1, 1, 1638632233); -- ---------------------------- -- Table structure for ape_document @@ -438,8 +469,8 @@ CREATE TABLE `ape_document` ( -- ---------------------------- -- Records of ape_document -- ---------------------------- -INSERT INTO `ape_document` VALUES (1, 1, '超级管理员', '我是首页', 1, '/uploads/images/20211111\\522a67179ee445a32039a9cd3030c378.jpg', 'article', '', 1, 1, 1, '', 1, 104, '张三,李四,王麻子', '编程文章', '', '', 99, 1636562845, 1636725820, 1, ''); -INSERT INTO `ape_document` VALUES (2, 1, '超级管理员', '测试摘要i', 1, '/uploads/images/20211114\\560c1956b3fa3b78cb82f7c801a8ede3.jpg', 'article', '', 0, 0, 0, '', 1, 53, '', '

测试摘要222222222222222222222222222

', '', '', 99, 1636822306, 1636822306, 1, ''); +INSERT INTO `ape_document` VALUES (1, 1, '超级管理员', '我是首页', 1, '/uploads/images/20211111\\522a67179ee445a32039a9cd3030c378.jpg', 'article', '', 1, 1, 1, '', 1, 170, '张三,李四,王麻子', '编程文章', '', '', 99, 1636562845, 1636725820, 1, ''); +INSERT INTO `ape_document` VALUES (2, 1, '超级管理员', '测试摘要i', 1, '/uploads/images/20211114\\560c1956b3fa3b78cb82f7c801a8ede3.jpg', 'article', '', 0, 0, 0, '', 1, 56, '', '

测试摘要222222222222222222222222222

', '', '', 99, 1636822306, 1636822306, 1, ''); -- ---------------------------- -- Table structure for ape_document_article @@ -485,7 +516,7 @@ CREATE TABLE `ape_document_category` ( -- Records of ape_document_category -- ---------------------------- INSERT INTO `ape_document_category` VALUES (1, '编程文章', '', '', 1, 0, 0, '', '', '', 1, 'list_default.html', '', 12, 0, 1636646746); -INSERT INTO `ape_document_category` VALUES (2, 'php', '', '', 1, 1, 0, '', '', '', 1, 'list_default.html', '', 31, 0, 0); +INSERT INTO `ape_document_category` VALUES (2, 'php', '', '', 1, 1, 0, '', '', '', 1, 'list_default.html', '', 34, 0, 0); -- ---------------------------- -- Table structure for ape_document_category_content @@ -596,7 +627,7 @@ CREATE TABLE `ape_pv_log` ( `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of ape_pv_log @@ -628,6 +659,15 @@ INSERT INTO `ape_pv_log` VALUES (24, 2, 23, '2021-11-28', '2021-11-28 02:00:01', INSERT INTO `ape_pv_log` VALUES (25, 20, 6, '2021-11-28', '2021-11-28 20:35:33', '2021-11-28 20:35:33'); INSERT INTO `ape_pv_log` VALUES (26, 23, 20, '2021-11-28', '2021-11-28 23:19:20', '2021-11-28 23:19:20'); INSERT INTO `ape_pv_log` VALUES (27, 0, 30, '2021-11-29', '2021-11-29 00:00:14', '2021-11-29 00:00:14'); +INSERT INTO `ape_pv_log` VALUES (28, 23, 32, '2021-12-04', '2021-12-04 23:20:50', '2021-12-04 23:20:50'); +INSERT INTO `ape_pv_log` VALUES (29, 15, 7, '2021-12-05', '2021-12-05 15:47:54', '2021-12-05 15:47:54'); +INSERT INTO `ape_pv_log` VALUES (30, 16, 2, '2021-12-05', '2021-12-05 16:30:37', '2021-12-05 16:30:37'); +INSERT INTO `ape_pv_log` VALUES (31, 17, 1, '2021-12-05', '2021-12-05 17:24:01', '2021-12-05 17:24:01'); +INSERT INTO `ape_pv_log` VALUES (32, 21, 11, '2021-12-05', '2021-12-05 21:37:58', '2021-12-05 21:37:58'); +INSERT INTO `ape_pv_log` VALUES (33, 22, 4, '2021-12-05', '2021-12-05 22:08:30', '2021-12-05 22:08:30'); +INSERT INTO `ape_pv_log` VALUES (34, 23, 14, '2021-12-05', '2021-12-05 23:13:18', '2021-12-05 23:13:18'); +INSERT INTO `ape_pv_log` VALUES (35, 0, 32, '2021-12-06', '2021-12-06 00:09:55', '2021-12-06 00:09:55'); +INSERT INTO `ape_pv_log` VALUES (36, 1, 1, '2021-12-06', '2021-12-06 01:01:26', '2021-12-06 01:01:26'); -- ---------------------------- -- Table structure for ape_slides @@ -674,7 +714,7 @@ CREATE TABLE `ape_system_config` ( `create_time` int(10) NOT NULL DEFAULT 0 COMMENT '添加时间', `update_time` int(10) NOT NULL DEFAULT 0 COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统配置表' ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统配置表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of ape_system_config @@ -703,6 +743,8 @@ INSERT INTO `ape_system_config` VALUES (21, 3, '数据库备份文件是否启 INSERT INTO `ape_system_config` VALUES (22, 3, '数据库备份文件压缩级别', 'data_backup_compress_level', 'text', 'input', 0, '', '4', '数据库备份文件的压缩级别,该配置在开启压缩时生效1:普通\n4:一般\n9:最高', 78, 1, 1, '1', '1', 1582793305, 1582792265); INSERT INTO `ape_system_config` VALUES (23, 1, '微信收款码', 'web_weixin_pay', 'file', 'input', 0, '', '/uploads/images/20211129\\7e67eef3314ace6ad4b7f75e04fc196d.jpg', '微信收款码', 77, 1, 1, '1', '1', 1582793305, 1582792265); INSERT INTO `ape_system_config` VALUES (24, 1, '支付宝收款码', 'web_zhifubao_pay', 'file', 'input', 0, '', '/uploads/images/20211129\\65eb4dd90488eb082d93d8f1163ed840.jpg', '支付宝收款码', 76, 1, 1, '1', '1', 1582793305, 1582792265); +INSERT INTO `ape_system_config` VALUES (25, 4, '是否登录', 'comment_need_login', 'radio', 'input', 0, '1=>是\n0=>否', '1', '', 91, 1, 1, '1', '1', 1583126643, 1582792265); +INSERT INTO `ape_system_config` VALUES (26, 4, '敏感词', 'comment_sensitive_word', 'text', 'input', 0, '', '新疆,华为', '多个逗号隔开', 81, 1, 1, '1', '1', 1582793305, 1582792265); -- ---------------------------- -- Table structure for ape_system_config_tab @@ -718,7 +760,7 @@ CREATE TABLE `ape_system_config_tab` ( `create_time` int(10) NOT NULL COMMENT '添加时间', `update_time` int(10) NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统配置分类' ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统配置分类' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of ape_system_config_tab @@ -726,6 +768,7 @@ CREATE TABLE `ape_system_config_tab` ( INSERT INTO `ape_system_config_tab` VALUES (1, '基础配置', 99, 1, '1', '1', 1582784937, 1583385482); INSERT INTO `ape_system_config_tab` VALUES (2, '上传配置', 98, 1, '1', '1', 1582785701, 1583385489); INSERT INTO `ape_system_config_tab` VALUES (3, '数据库配置', 98, 1, '1', '1', 1582785701, 1583385489); +INSERT INTO `ape_system_config_tab` VALUES (4, '留言配置', 99, 1, '1', '1', 1582784937, 1583385482); -- ---------------------------- -- Table structure for ape_tag @@ -761,7 +804,7 @@ CREATE TABLE `ape_url_log` ( `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'pv记录表' ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'pv记录表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of ape_url_log @@ -804,6 +847,14 @@ INSERT INTO `ape_url_log` VALUES (35, 'http://apeblog.io/index/article/lists.htm INSERT INTO `ape_url_log` VALUES (36, 'http://apeblog.io/index/article/detail.html?id=2', 15, '测试摘要i', '2021-11-29', NULL, NULL); INSERT INTO `ape_url_log` VALUES (37, 'http://apeblog.io/', 7, '网站首页', '2021-11-29', NULL, NULL); INSERT INTO `ape_url_log` VALUES (38, 'http://apeblog.io/index/article/detail.html?id=1', 1, '我是首页', '2021-11-29', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (39, 'http://apeblog.io/', 11, '网站首页', '2021-12-04', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (40, 'http://apeblog.io/index/article/detail.html?id=1', 2, '我是首页', '2021-12-04', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (41, 'http://apeblog.io/index/article/lists.html?id=2', 2, 'php', '2021-12-04', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (42, 'http://apeblog.io/index/article/detail.html?id=2', 3, '测试摘要i', '2021-12-04', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (43, 'http://apeblog.io/', 3, '网站首页', '2021-12-05', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (44, 'http://apeblog.io/index/article/lists.html?id=2', 1, 'php', '2021-12-05', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (45, 'http://apeblog.io/index/article/detail.html?id=1', 31, '我是首页', '2021-12-05', NULL, NULL); +INSERT INTO `ape_url_log` VALUES (46, 'http://apeblog.io/index/article/detail.html?id=1', 33, '我是首页', '2021-12-06', NULL, NULL); -- ---------------------------- -- Table structure for ape_user @@ -841,7 +892,7 @@ CREATE TABLE `ape_uv_log` ( `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Uv记录表' ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Uv记录表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of ape_uv_log @@ -858,5 +909,8 @@ INSERT INTO `ape_uv_log` VALUES (9, '127.0.0.1', 23, '2021-11-24', '2021-11-24 2 INSERT INTO `ape_uv_log` VALUES (10, '127.0.0.1', 22, '2021-11-27', '2021-11-27 22:26:28', '2021-11-27 22:26:28'); INSERT INTO `ape_uv_log` VALUES (11, '127.0.0.1', 1, '2021-11-28', '2021-11-28 01:08:30', '2021-11-28 01:08:30'); INSERT INTO `ape_uv_log` VALUES (12, '127.0.0.1', 0, '2021-11-29', '2021-11-29 00:00:14', '2021-11-29 00:00:14'); +INSERT INTO `ape_uv_log` VALUES (13, '127.0.0.1', 23, '2021-12-04', '2021-12-04 23:20:50', '2021-12-04 23:20:50'); +INSERT INTO `ape_uv_log` VALUES (14, '127.0.0.1', 15, '2021-12-05', '2021-12-05 15:47:54', '2021-12-05 15:47:54'); +INSERT INTO `ape_uv_log` VALUES (15, '127.0.0.1', 0, '2021-12-06', '2021-12-06 00:09:55', '2021-12-06 00:09:55'); SET FOREIGN_KEY_CHECKS = 1; diff --git a/app/common/taglib/Ape.php b/app/common/taglib/Ape.php index 927b4a2..5203ce7 100644 --- a/app/common/taglib/Ape.php +++ b/app/common/taglib/Ape.php @@ -7,17 +7,17 @@ class Ape extends TagLib{ */ protected $tags = [ // 标签定义: attr 属性列表 close 是否闭合(0 或者1 默认1) alias 标签别名 level 嵌套层次 - 'channel'=> ['attr' => 'type,typeid,row,void,where,orderby,display', 'close' => 1], - 'arclist'=> ['attr' => 'typeid,orderby,row,void,model,type,where,display,ids,limit', 'close' => 1], - 'type'=> ['attr' => 'typeid', 'close' => 1], - 'list'=> ['attr' => 'orderby,pagesize,type,typeid,void,model,where,display', 'close' => 1], + 'channel'=> ['attr' => 'type,typeId,row,void,where,orderBy,display', 'close' => 1], + 'arclist'=> ['attr' => 'typeId,orderBy,row,void,model,type,where,display,ids,limit', 'close' => 1], + 'type'=> ['attr' => 'typeId', 'close' => 1], + 'list'=> ['attr' => 'orderBy,pageSize,type,typeId,void,model,where,display', 'close' => 1], 'prenext'=> ['attr' => 'get,cid,void,none', 'close' => 1], 'flink'=> ['attr' => 'type,row,void', 'close' => 1], 'banner'=> ['attr' => 'type,row,void', 'close' => 1], 'advert'=> ['attr' => 'type,row,void', 'close' => 1], 'sql'=> ['attr' => 'sql', 'close' => 1], 'article'=> ['attr' => 'id,void,model', 'close' => 1], - 'comment'=> ['attr' => 'id,void,orderby,pagesize', 'close' => 1], + 'comment'=> ['attr' => 'typeId,void,type,pageSize,orderBy', 'close' => 1], 'relevant'=> ['attr' => 'id,model,void,row', 'close' => 1], 'tags'=> ['attr' => 'tags,void', 'close' => 1], ]; @@ -26,16 +26,16 @@ class Ape extends TagLib{ /** * 栏目列表 * type,栏目分类数据读取分类 - * typeid,栏目分类,数字,字符串,或者变量 + * typeId,栏目分类,数字,字符串,或者变量 */ public function tagChannel($tag,$content) { $type=isset($tag['type'])?$tag['type']:'son'; - $typeid=isset($tag['typeid'])?$tag['typeid']:'$cid'; + $typeId=isset($tag['typeId'])?$tag['typeId']:'$cid'; $row=isset($tag['row'])?$tag['row']:100; $void=isset($tag['void'])?$tag['void']:'field'; $where=isset($tag['where'])?$tag['where']:''; - $orderby=isset($tag['orderby'])?$tag['orderby']:'sort asc'; + $orderBy=isset($tag['orderBy'])?$tag['orderBy']:'sort asc'; $display=isset($tag['display'])?$tag['display']:1; $display=$display==1?1:0; @@ -45,11 +45,11 @@ class Ape extends TagLib{ //2、多个栏目id,逗号隔开 //3、变量 //只有当多个栏目id时,才需要单引号加持。保证生成的为字符串 - if(strpos($typeid,',')){ - $typeid="'$typeid'"; + if(strpos($typeId,',')){ + $typeId="'$typeId'"; } $parse = ''; $parse .= '{volist name="__LIST__" id="'.$void.'"}'; $parse .= $content; @@ -62,15 +62,14 @@ class Ape extends TagLib{ */ public function tagArclist($tag,$content) { - $typeid = isset($tag['typeid'])?$tag['typeid']:'$cid'; - $orderby=isset($tag['orderby'])?$tag['orderby']:'sort asc,create_time desc'; + $typeId = isset($tag['typeId'])?$tag['typeId']:'$cid'; + $orderBy=isset($tag['orderBy'])?$tag['orderBy']:'sort asc,create_time desc'; $row=isset($tag['row'])?$tag['row']:'100'; $void=isset($tag['void'])?$tag['void']:'field'; $model=isset($tag['model'])?$tag['model']:'article'; $type=isset($tag['type'])?$tag['type']:'find'; $where=isset($tag['where'])?$tag['where']:''; $ids=isset($tag['ids'])?$tag['ids']:''; - $limit=isset($tag['limit'])?$tag['limit']:'100'; //limit参数优先于row if(isset($tag['limit'])){ $row=$tag['limit']; @@ -84,12 +83,12 @@ class Ape extends TagLib{ //2、多个栏目id,逗号隔开 //3、变量 //只有当多个栏目id时,才需要单引号加持。保证生成的为字符串 - if(strpos($typeid,',')){ - $typeid="'$typeid'"; + if(strpos($typeId,',')){ + $typeId="'$typeId'"; } $parse = ''; $parse .= '{volist name="__LIST__" id="'.$void.'"}'; $parse .= $content; @@ -102,13 +101,13 @@ class Ape extends TagLib{ */ public function tagType($tag,$content) { - if(!isset($tag['typeid'])){ + if(!isset($tag['typeId'])){ return ''; } - $typeid = $tag['typeid']; + $typeId = $tag['typeId']; $parse = ''; $parse .= '{volist name="__LIST__" id="field"}'; $parse .= $content; @@ -122,17 +121,17 @@ class Ape extends TagLib{ */ public function tagList($tag,$content) { - $orderby=isset($tag['orderby'])?$tag['orderby']:'sort asc,create_time desc'; - $pagesize=isset($tag['pagesize'])?$tag['pagesize']:15; + $orderBy=isset($tag['orderBy'])?$tag['orderBy']:'sort asc,create_time desc'; + $pageSize=isset($tag['pageSize'])?$tag['pageSize']:15; $type=isset($tag['type'])?$tag['type']:'find'; - $typeid=isset($tag['typeid'])?$tag['typeid']:'$cid'; + $typeId=isset($tag['typeId'])?$tag['typeId']:'$cid'; $void=isset($tag['void'])?$tag['void']:'field'; $model=isset($tag['model'])?$tag['model']:'article'; $where=isset($tag['where'])?$tag['where']:''; $display=isset($tag['display'])?$tag['display']:1; $display=$display==1?1:0; $parse = 'render();'; $parse .= ' ?>'; $parse .= '{volist name="__LIST__" id="'.$void.'" key="i"}'; @@ -222,8 +221,6 @@ class Ape extends TagLib{ return $parse; } - - /** * 执行SQL */ @@ -292,17 +289,16 @@ class Ape extends TagLib{ */ public function tagComment($tag,$content) { - if(!isset($tag['id'])){ - return ''; - } - $documentId = $tag['id']; + $pageSize=isset($tag['pageSize'])?$tag['pageSize']:10; + $type=isset($tag['type'])?$tag['type']:'top'; + $typeId=isset($tag['typeId'])?$tag['typeId']:0; $void=isset($tag['void'])?$tag['void']:'field'; - $orderBy=isset($tag['orderby'])?$tag['orderby']:'sort asc,create_time desc'; - $pageSize=isset($tag['pagesize'])?$tag['pagesize']:15; + $orderBy=isset($tag['orderBy'])?$tag['orderBy']:'id asc'; $parse = 'render();'; $parse .= ' ?>'; - $parse .= '{volist name="$__LIST__" id="'.$void.'"}'; + $parse .= '{volist name="__LIST__" id="'.$void.'" key="i"}'; $parse .= $content; $parse .= '{/volist}'; return $parse; diff --git a/app/index/common.php b/app/index/common.php index 31a6734..558f2c4 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -56,7 +56,7 @@ function get_document_category_list() $documentCategory = []; foreach ($documentCategoryList as $key => $item) { //根据栏目类型,生成栏目url - $item['url'] = curl($item); + $item['url'] = make_category_url($item); $documentCategory[$item['id']] = $item; } cache(Data::DATA_DOCUMENT_CATEGORY_LIST, $documentCategory); @@ -115,7 +115,7 @@ function get_document_category_by_name($name, $field = false) /** * 模板-获取文章分类 * @param $type - * @param $typeid + * @param $typeId * @param int $row * @param string $where * @param string $orderby @@ -127,7 +127,7 @@ function get_document_category_by_name($name, $field = false) * @author 李玉坤 * @date 2021-11-12 21:48 */ -function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '') +function tpl_get_channel($type, $typeId, $row = 100, $where = '', $orderby = '') { switch ($type) { @@ -141,17 +141,17 @@ function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '') break; case 'son': //获取子级分类 - if (!$typeid) { + if (!$typeId) { throw new Exception('请指定要获取的栏目分类id!'); } - return get_document_category_by_parent($typeid, $row); + return get_document_category_by_parent($typeId, $row); break; case 'self': //获取同级分类 - if (!$typeid) { + if (!$typeId) { throw new Exception('请指定要获取的栏目分类id!'); } - $dc = get_document_category($typeid); + $dc = get_document_category($typeId); if (!$dc) { return false; } @@ -159,10 +159,10 @@ function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '') break; case 'find': //获取所有子孙分类,此操作读取数据库,非缓存! - if (!$typeid) { + if (!$typeId) { throw new Exception('请指定要获取的栏目分类id!'); } - $dc = get_document_category($typeid); + $dc = get_document_category($typeId); if (!$dc) { throw new Exception('分类不存在或已删除!'); } @@ -170,35 +170,35 @@ function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '') $tempArr = $tempArr->select(); foreach ($tempArr as $key => $item) { //根据栏目类型,生成栏目url - $item['url'] = curl($item); + $item['url'] = make_category_url($item); $tempArr[$key] = $item; } return $tempArr; break; case 'parent': //获取父级分类 - if (!$typeid) { + if (!$typeId) { throw new Exception('请指定要获取的栏目分类id!'); } - $dc = get_document_category($typeid); + $dc = get_document_category($typeId); $tempArr = array(); $parent = get_document_category($dc['pid']); array_push($tempArr, $parent); return $tempArr; break; case 'root': - if (!$typeid) { + if (!$typeId) { throw new Exception('请指定要获取的栏目分类id!'); } - $dc = get_document_category($typeid); + $dc = get_document_category($typeId); if ($dc['pid'] != 0) { //获取根分类,此操作读取数据库,非缓存! $dc = DocumentCategory::where('pid', 0)->where('status', 1) - ->where("CONCAT(',',child,',') like '%,$typeid,%'")->limit($row); + ->where("CONCAT(',',child,',') like '%,$typeId,%'")->limit($row); $dc = $dc->find(); } //根据栏目类型,生成栏目url - $dc['url'] = curl($dc); + $dc['url'] = make_category_url($dc); $tempArr = []; array_push($tempArr, $dc); return $tempArr; @@ -209,18 +209,18 @@ function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '') $tempArr = $tempArr->select(); foreach ($tempArr as $key => $item) { //根据栏目类型,生成栏目url - $item['url'] = curl($item); + $item['url'] = make_category_url($item); $tempArr[$key] = $item; } return $tempArr; break; case 'ids': //根据多个栏目id,逗号隔开的那种,获得栏目列表 - $tempArr = DocumentCategory::where('status', 1)->where('id', 'in', $typeid)->order($orderby)->limit($row); + $tempArr = DocumentCategory::where('status', 1)->where('id', 'in', $typeId)->order($orderby)->limit($row); $tempArr = $tempArr->select(); foreach ($tempArr as $key => $item) { //根据栏目类型,生成栏目url - $item['url'] = curl($item); + $item['url'] = make_category_url($item); $tempArr[$key] = $item; } return $tempArr; @@ -305,13 +305,13 @@ function tpl_get_prenext($get, $cid = false, $none) /** * 模板-获取文章列表 * $orderby=数据排序方式 - * $pagesize=每页显示的数据数目 + * $pageSize=每页显示的数据数目 * $cid=栏目分类id * $type=读取数据的方式(son:'获取栏目下文章以及所有子孙分类文章',self:'获取栏目下文章',search:'获取关键字搜索的文章',where:'根据自定义条件获取文章(where语句)') * $table=文章内容扩展表名,默认article * $where=自定义条件 */ -function tpl_get_list($orderby, $pagesize, $cid, $type, $table = 'article', $where = false, $display = 1) +function tpl_get_list($orderby, $pageSize, $cid, $type, $table = 'article', $where = false, $display = 1) { $documentListModel = (new Document()) @@ -371,14 +371,14 @@ function tpl_get_list($orderby, $pagesize, $cid, $type, $table = 'article', $whe //获取当前请求的请求参数,以确定分页是否要带上这些请求参数 $query = request()->query(); if ($query) { - $documentListModel = $documentListModel->paginate($pagesize, false, ['query' => getRouteQuery()]); + $documentListModel = $documentListModel->paginate($pageSize, false, ['query' => get_route_query()]); } else { - $documentListModel = $documentListModel->paginate($pagesize); + $documentListModel = $documentListModel->paginate($pageSize); } $lists = []; foreach ($documentListModel as $key => $item) { //生成文章url - $item['url'] = aurl($item); + $item['url'] = make_detail_url($item); $lists[$key] = $item; } $re = [ @@ -392,7 +392,7 @@ function tpl_get_list($orderby, $pagesize, $cid, $type, $table = 'article', $whe * 获得当前路由及参数列表 * @return mixed */ -function getRouteQuery() +function get_route_query() { $request = request(); $queryArr = $request->param(); @@ -403,7 +403,7 @@ function getRouteQuery() /** * 根据栏目类型,生成栏目url */ -function curl($item) +function make_category_url($item) { if ((int)$item['type'] == 0) { return url('article/lists?id=' . $item['id'])->build(); @@ -417,7 +417,7 @@ function curl($item) /** * 生成文章url */ -function aurl($item) +function make_detail_url($item) { //根据栏目类型,生成栏目url if ($item['link_str']) { @@ -445,7 +445,7 @@ function tpl_get_article($id, $table) return false; } - $doc['url'] = aurl($doc); + $doc['url'] = make_detail_url($doc); return $doc; } @@ -462,7 +462,6 @@ function tpl_get_article($id, $table) */ function tpl_get_article_list($cid, $row, $orderby, $table = 'article', $type = 'son', $where = false, $display = 1, $ids = '') { - $documentListModel = Document::alias('a') ->join(config('database.prefix') . 'document_category b', 'a.category_id=b.id', 'LEFT') ->join(config('database.prefix') . "document_$table c", 'a.id=c.id', 'RIGHT') @@ -507,7 +506,7 @@ function tpl_get_article_list($cid, $row, $orderby, $table = 'article', $type = $lists = []; foreach ($documentListModel as $key => $item) { //生成文章url - $item['url'] = aurl($item); + $item['url'] = make_detail_url($item); $lists[$key] = $item; } return $lists; @@ -628,24 +627,31 @@ if (!function_exists('web_config')) { * @author 李玉坤 * @date 2021-11-12 0:34 */ -function tpl_get_tags_list($tags) -{ - if (!$tags) { - return false; +if (!function_exists('tpl_get_tags_list')) { + function tpl_get_tags_list($tags) + { + if (!$tags) { + return false; + } + $tagArr = explode(',', $tags); + $tagTemp = []; + foreach ($tagArr as $item) { + $data['title'] = $item; + $data['url'] = url('article/tag?t=' . urlencode($item)); + array_push($tagTemp, $data); + } + return $tagTemp; } - $tagArr = explode(',', $tags); - $tagTemp = []; - foreach ($tagArr as $item) { - $data['title'] = $item; - $data['url'] = url('article/tag?t=' . urlencode($item)); - array_push($tagTemp, $data); - } - return $tagTemp; } - /** * 模板-获取页面的面包屑导航 + * @param $dc + * @param array $positionList + * @return string + * @throws Exception + * @author 李玉坤 + * @date 2021-12-05 22:40 */ function tpl_get_position($dc, $positionList = array()) { @@ -665,37 +671,61 @@ function tpl_get_position($dc, $positionList = array()) /** * 获取文章评论列表 - * @param $documentId - * @param $orderBy - * @param $pageSize + * @param $id + * @param $type + * @param int $pageSize + * @param string $orderBy * @return array * @throws \think\db\exception\DbException * @author 李玉坤 - * @date 2021-11-28 0:51 + * @date 2021-12-05 23:54 */ -function tpl_get_comment_list($documentId,$orderBy, $pageSize) +function tpl_get_comment_list($id,$type,$pageSize = 10,$orderBy) { - $commentList = \app\common\model\Comment::where('document_id',$documentId)->where('status', 1)->order($orderBy); + $commentModel = \app\common\model\Comment::where('status', 1)->order($orderBy); + switch ($type) { + case 'top': + //根据自定义条件获取文章(where语句) + $commentModel = $commentModel->where('document_id', $id); + break; + case 'son': + //获取栏目下文章 + $commentModel = $commentModel->where('pid', $id); + break; + } //获取当前请求的请求参数,以确定分页是否要带上这些请求参数 $query = request()->query(); if ($query) { - $commentList = $commentList->paginate($pageSize, false, ['query' => getRouteQuery()]); + $commentModel = $commentModel->paginate( $pageSize,false, ['query' => get_route_query()]); } else { - $commentList = $commentList->paginate($pageSize); + $commentModel = $commentModel->paginate($pageSize); } $lists = []; - foreach ($commentList as $key => $item) { - //生成文章url - $item['url'] = aurl($item); + foreach ($commentModel as $key => $item) { + $item['reply_url'] = url('article/comment_reply?pid=' . $item['id'])->build();; $lists[$key] = $item; } $re = [ - 'model' => $commentList, + 'model' => $commentModel, 'lists' => $lists ]; return $re; } +/** + * 获取评论数量 + * @param $documentId + * @return int + * @author 李玉坤 + * @date 2021-12-05 23:16 + */ +function get_comment_count($documentId) +{ + return \app\common\model\Comment::where('document_id',$documentId)->where('status', 1)->count(); +} + + + /** * 获取文章相关文章 * @param $documentId @@ -740,7 +770,7 @@ function tpl_get_relevant_list($documentId, $row, $table = 'article') $lists = []; foreach ($relevantList as $key => $item) { //生成文章url - $item['url'] = aurl($item); + $item['url'] = make_detail_url($item); $lists[$key] = $item; } return $relevantList; @@ -759,7 +789,7 @@ function GetTopTypename($id = false) } //获取顶级id -function GetTopTypeid($id = false) +function GetToptypeId($id = false) { $id = $id ? $id : input('id'); $dc = get_document_category($id); @@ -767,7 +797,7 @@ function GetTopTypeid($id = false) return $dc['id']; } - return GetTopTypeid($dc['pid']); + return GetToptypeId($dc['pid']); } //获取顶级栏目图片 @@ -811,13 +841,13 @@ function GetTopTypenameen($id = false) * $cid=栏目id,首页可不填此参数 * $curr_id=当前页面栏目id,首页可不填此参数 */ -function IsActiveNav($curr_cid = false, $cid = false) +function is_active_nav($currCid = false, $cid = false) { if (request()->action() == 'search') { return false; } //首页 - if (!$curr_cid && !$cid) { + if (!$currCid && !$cid) { return true; } @@ -827,16 +857,16 @@ function IsActiveNav($curr_cid = false, $cid = false) } //如果分类id相等,是在同一页面中 - if ($cid == $curr_cid) { + if ($cid == $currCid) { return true; } //判断是否在同一栏目树下。 - $parent_id = cache(Data::CURR_CATEGORY_PATENT_ID); + $parentId = cache(Data::CURR_CATEGORY_PATENT_ID); - $parent_id = explode(',', $parent_id); + $parentId = explode(',', $parentId); - if (in_array($cid, $parent_id)) { + if (in_array($cid, $parentId)) { return true; } @@ -845,7 +875,7 @@ function IsActiveNav($curr_cid = false, $cid = false) // 查看是否为手机端的方法 //判断是手机登录还是电脑登录 -function ismobile() +function is_mobile() { // 如果有HTTP_X_WAP_PROFILE则一定是移动设备 if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) @@ -879,23 +909,35 @@ function ismobile() return false; } +/** + * 加载svg + * @param $path + * @author 李玉坤 + * @date 2021-12-05 21:35 + */ function file_echo_svg($path) { $svg = file_get_contents(public_path().$path); print_r($svg); } -function file_load_face() +/** + * 加载表情 + * @param $path + * @return string|null + * @author 李玉坤 + * @date 2021-12-05 21:36 + */ +function file_load_face($path) { - - $files = scandir(THEME_PATH . "/static/img/face"); - $html = null; + $files = scandir(public_path().$path); + $html = ''; foreach ($files as $v) { /* if(is_file($v)){ $fileItem[] = $v; }*/ if (pathinfo($v, PATHINFO_EXTENSION) == 'gif') { - $html = '' . $html; + $html = '' . $html; } } diff --git a/app/index/config/view.php b/app/index/config/view.php index 449aa79..9b13524 100644 --- a/app/index/config/view.php +++ b/app/index/config/view.php @@ -9,7 +9,7 @@ if (file_exists(public_path("template/{$theme}"))){ $theme = 'default'; } //检查是否切换模板 -if(ismobile() == "wap" && file_exists(public_path("template/{$theme}/mobile"))) { +if(is_mobile() == "wap" && file_exists(public_path("template/{$theme}/mobile"))) { $mode = "mobile"; } else { $mode = "pc"; diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 4063b36..882976c 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -158,7 +158,7 @@ class Article extends Base //缓存当前页面栏目分类树ids cache(Data::CURR_CATEGORY_PATENT_ID,$dc['pid']?$dc['pid'].','.$article['category_id']:$article['category_id']); //设置文章的url - $article['link_str']=aurl($article); + $article['link_str']=make_detail_url($article); //判断后台统计配置是否开启 1 开启 if(web_config("web_statistics") ==1){ //统计url diff --git a/public/template/default/pc/article/list_default.html b/public/template/default/pc/article/list_default.html index 20cbe42..15561cc 100644 --- a/public/template/default/pc/article/list_default.html +++ b/public/template/default/pc/article/list_default.html @@ -104,8 +104,8 @@
- - + {notempty name="(web_config('web_weixin_pay'))"}{/notempty} + {notempty name="(web_config('web_zhifubao_pay'))"}{/notempty}
@@ -170,102 +170,7 @@ 添加表情
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {:file_load_face('__IMG__/face/')}
@@ -293,47 +198,99 @@ - - -

共有0条评论

-
- - - 沙发空余 -
- - - + + +

共有{:get_comment_count($apeField['id'])}条评论

+
+ {if get_comment_count($apeField['id']) ==0} + 沙发空余 + {/if}
- {/if} + +
    + {ape:comment typeId="$apeField['id']" void='field'} +
  1. +
    +
    +
    + +
    +
    + +
    + {ape:comment type="top" typeId="$field['id']" void="vo"} +
      +
    1. +
      +
      +
      + +
      +
      + +
      + +
    2. +
    + {/ape:comment} +
  2. + {/ape:comment} +
+ + + + + {/if}