一大波修复

This commit is contained in:
liyukun 2021-12-06 01:02:20 +08:00
parent bf8a36a495
commit 16c600038c
7 changed files with 309 additions and 260 deletions

View File

@ -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, '', '<p>测试摘要222222222222222222222222222</p>', '', '', 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, '', '<p>测试摘要222222222222222222222222222</p>', '', '', 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;

View File

@ -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 = '<?php ';
$parse .= '$__LIST__ = '."tpl_get_channel(\"$type\",$typeid,$row,\"$where\",\"$orderby\",$display);";
$parse .= '$__LIST__ = '."tpl_get_channel(\"$type\",$typeId,$row,\"$where\",\"$orderBy\",$display);";
$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 = '<?php ';
$parse .= '$__LIST__ = '."tpl_get_article_list($typeid,\"$row\",\"$orderby\",\"$model\",\"$type\",\"$where\",$display,\"$ids\");";;
$parse .= '$__LIST__ = '."tpl_get_article_list($typeId,\"$row\",\"$orderBy\",\"$model\",\"$type\",\"$where\",$display,\"$ids\");";;
$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 = '<?php ';
$parse .= '$__LIST__ =[];array_push($__LIST__,get_document_category('.$typeid.'));';
$parse .= '$__LIST__ =[];array_push($__LIST__,get_document_category('.$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 = '<?php ';
$parse .= '$__FUN__ ='."tpl_get_list(\"$orderby\",$pagesize,$typeid,\"$type\",\"$model\",\"$where\",$display);";
$parse .= '$__FUN__ ='."tpl_get_list(\"$orderBy\",$pageSize,$typeId,\"$type\",\"$model\",\"$where\",$display);";
$parse .= '$__LIST__ =$__FUN__["lists"];$pager = $__FUN__["model"]->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 = '<?php ';
$parse .= '$__TAG_LIST__ ='."tpl_get_comment_list($documentId,$orderBy,$pageSize);";
$parse .= '$__FUN__ ='."tpl_get_comment_list($typeId,\"$type\",$pageSize,\"$orderBy\");";
$parse .= '$__LIST__ = $__FUN__["lists"];$pager = $__FUN__["model"]->render();';
$parse .= ' ?>';
$parse .= '{volist name="$__LIST__" id="'.$void.'"}';
$parse .= '{volist name="__LIST__" id="'.$void.'" key="i"}';
$parse .= $content;
$parse .= '{/volist}';
return $parse;

View File

@ -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 = '<img class="img-pace" src="' . THEME_IMG_PATH . '/face/' . $v . '" width="30" facename="' . basename($v, ".gif") . '">' . $html;
$html = '<img class="img-pace" src="' . $path . $v . '" width="30" facename="' . basename($v, ".gif") . '">' . $html;
}
}

View File

@ -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";

View File

@ -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

View File

@ -104,8 +104,8 @@
<div id="qrcode-img"></div>
</div>
<div id="reward-plane" class="post-pop-plane">
<img src="{:file_cdn(web_config('web_weixin_pay'))}" alt="">
<img src="{:file_cdn(web_config('web_zhifubao_pay'))}" alt="" />
{notempty name="(web_config('web_weixin_pay'))"}<img src="{:file_cdn(web_config('web_weixin_pay'))}" alt="">{/notempty}
{notempty name="(web_config('web_zhifubao_pay'))"}<img src="{:file_cdn(web_config('web_zhifubao_pay'))}" alt="" />{/notempty}
</div>
</div>
<div class="post-turn-page-plane">
@ -170,102 +170,7 @@
<i class="far fa-smile-wink">
</i>添加表情</button>
<div class="conment-face-plane">
<img class="img-pace" src="__IMG__/face/yun.gif" width="30"
facename="yun">
<img class="img-pace" src="__IMG__/face/youling.gif" width="30"
facename="youling">
<img class="img-pace" src="__IMG__/face/yiwen.gif" width="30"
facename="yiwen">
<img class="img-pace" src="__IMG__/face/yinxian.gif" width="30"
facename="yinxian">
<img class="img-pace" src="__IMG__/face/xigua.gif" width="30"
facename="xigua">
<img class="img-pace" src="__IMG__/face/xieyanxiao.gif"
width="30" facename="xieyanxiao">
<img class="img-pace" src="__IMG__/face/xiaoku.gif" width="30"
facename="xiaoku">
<img class="img-pace" src="__IMG__/face/xiaojiujie.gif"
width="30" facename="xiaojiujie">
<img class="img-pace" src="__IMG__/face/wunai.gif" width="30"
facename="wunai">
<img class="img-pace" src="__IMG__/face/wozuimei.gif" width="30"
facename="wozuimei">
<img class="img-pace" src="__IMG__/face/woshou.gif" width="30"
facename="woshou">
<img class="img-pace" src="__IMG__/face/weiqu.gif" width="30"
facename="weiqu">
<img class="img-pace" src="__IMG__/face/tuosai.gif" width="30"
facename="tuosai">
<img class="img-pace" src="__IMG__/face/touxiao.gif" width="30"
facename="touxiao">
<img class="img-pace" src="__IMG__/face/tiaopi.gif" width="30"
facename="tiaopi">
<img class="img-pace" src="__IMG__/face/shuai.gif" width="30"
facename="shuai">
<img class="img-pace" src="__IMG__/face/shengli.gif" width="30"
facename="shengli">
<img class="img-pace" src="__IMG__/face/se.gif" width="30"
facename="se">
<img class="img-pace" src="__IMG__/face/quantou.gif" width="30"
facename="quantou">
<img class="img-pace" src="__IMG__/face/qinqin.gif" width="30"
facename="qinqin">
<img class="img-pace" src="__IMG__/face/qiang.gif" width="30"
facename="qiang">
<img class="img-pace" src="__IMG__/face/piezui.gif" width="30"
facename="piezui">
<img class="img-pace" src="__IMG__/face/penxue.gif" width="30"
facename="penxue">
<img class="img-pace" src="__IMG__/face/nanguo.gif" width="30"
facename="nanguo">
<img class="img-pace" src="__IMG__/face/liuhan.gif" width="30"
facename="liuhan">
<img class="img-pace" src="__IMG__/face/lenghan.gif" width="30"
facename="lenghan">
<img class="img-pace" src="__IMG__/face/leiben.gif" width="30"
facename="leiben">
<img class="img-pace" src="__IMG__/face/ku.gif" width="30"
facename="ku">
<img class="img-pace" src="__IMG__/face/koubi.gif" width="30"
facename="koubi">
<img class="img-pace" src="__IMG__/face/keai.gif" width="30"
facename="keai">
<img class="img-pace" src="__IMG__/face/jingkong.gif" width="30"
facename="jingkong">
<img class="img-pace" src="__IMG__/face/jie.gif" width="30"
facename="jie">
<img class="img-pace" src="__IMG__/face/huaixiao.gif" width="30"
facename="huaixiao">
<img class="img-pace" src="__IMG__/face/hanxiao.gif" width="30"
facename="hanxiao">
<img class="img-pace" src="__IMG__/face/haixiu.gif" width="30"
facename="haixiu">
<img class="img-pace" src="__IMG__/face/guzhang.gif" width="30"
facename="guzhang">
<img class="img-pace" src="__IMG__/face/ganga.gif" width="30"
facename="ganga">
<img class="img-pace" src="__IMG__/face/fadai.gif" width="30"
facename="fadai">
<img class="img-pace" src="__IMG__/face/doge.gif" width="30"
facename="doge">
<img class="img-pace" src="__IMG__/face/dabing.gif" width="30"
facename="dabing">
<img class="img-pace" src="__IMG__/face/ciya.gif" width="30"
facename="ciya">
<img class="img-pace" src="__IMG__/face/caidao.gif" width="30"
facename="caidao">
<img class="img-pace" src="__IMG__/face/cahan.gif" width="30"
facename="cahan">
<img class="img-pace" src="__IMG__/face/bizui.gif" width="30"
facename="bizui">
<img class="img-pace" src="__IMG__/face/baoquan.gif" width="30"
facename="baoquan">
<img class="img-pace" src="__IMG__/face/aoman.gif" width="30"
facename="aoman">
<img class="img-pace" src="__IMG__/face/aixin.gif" width="30"
facename="aixin">
<img class="img-pace" src="__IMG__/face/OK.gif" width="30"
facename="OK">
{:file_load_face('__IMG__/face/')}
</div>
</div>
</div>
@ -293,47 +198,99 @@
</div>
</form>
</div>
<!-- #respond -->
<meta content="UserComments:0" itemprop="interactionCount">
<h3 class="comments-title">共有<span class="commentCount">0</span>条评论</h3>
<div class="comment-sofa">
<i class="fas fa-couch">
</i>
沙发空余
</div>
<script type='text/javascript' src='__JS__/comment-reply.min.js'></script>
<script type='text/javascript'>
$("body").on("click", ".comment-reply-link",
function(e) {
addComment.moveForm("li-comment-" + $(this).attr("data-commentid"), $(this).attr("data-commentid"), "respond", $(this).attr("data-postid"));
console.log("li-comment-" + $(this).attr("data-commentid"), $(this).attr("data-commentid"), "respond", $(this).attr("data-postid"));
e.stopPropagation();
return false;
});
$(document).click(function(e) {
$(".conment-face-plane").css("opacity", "0");
$(".conment-face-plane").css("visibility", "hidden");
e.stopPropagation();
});
$("body").on("click", ".img-pace",
function(e) {
$(".comment_form_textarea").val($(".comment_form_textarea").val() + "[f=" + $(this).attr("facename") + "]");
});
$("body").on("click", ".popover-btn-face",
function(e) {
if ($(".conment-face-plane").css("visibility") == "visible") {
$(".conment-face-plane").css("opacity", "0");
$(".conment-face-plane").css("visibility", "hidden");
} else {
$(".conment-face-plane").css("opacity", "1");
$(".conment-face-plane").css("visibility", "visible");
}
e.stopPropagation();
});
</script>
<nav class="comment-navigation pages"></nav>
<!-- #respond -->
<meta content="UserComments:0" itemprop="interactionCount">
<h3 class="comments-title">共有<span class="commentCount">{:get_comment_count($apeField['id'])}</span>条评论</h3>
<div class="comment-sofa">
{if get_comment_count($apeField['id']) ==0}
<i class="fas fa-couch"></i>沙发空余
{/if}
</div>
{/if}
<ol class="commentlist">
{ape:comment typeId="$apeField['id']" void='field'}
<li class="comment">
<div class="comment-item" id="comment-{$field['id']}">
<div class="comment-media">
<div class="avatar-img">
<img src="https://sdn.geekzu.org/avatar/077fbf9053ac9adf86bbe4af06cd9193?s=48&amp;d=mm&amp;r=g" alt="">
</div>
</div>
<div class="comment-metadata">
<div class="media-body">
<p class="author_name">{$field['author']}<a href="{$field['url']}" rel="external nofollow ugc" target="_blank" class="url"></a><span class="comment-zhan"><img title="网站主" src="__IMG__/zhan.svg" alt=""></span></p>
<div class="comment-text">
<p>{$field['content']}</p>
</div>
</div>
<span class="comment-pub-time">{$field['create_time']}</span>
<span class="comment-btn-reply">
<a rel="nofollow" class="comment-reply-link" href="{$field['reply_url']}" data-commentid="{$field['id']}" data-postid="{$apeField['id']}" data-belowelement="comment-{$field['id']}" data-respondelement="respond" data-replyto="回复给{$field['author']}" aria-label="回复给{$field['author']}"><i class="fa fa-reply"></i> 回复</a>
</span>
</div>
</div>
{ape:comment type="top" typeId="$field['id']" void="vo"}
<ol class="children">
<li class="comment">
<div class="comment-item" id="comment-{$vo.id}">
<div class="comment-media">
<div class="avatar-img">
<img src="https://sdn.geekzu.org/avatar/17ed02eb0367e16c4f964f4c9b1bfe38?s=48&amp;d=mm&amp;r=g" alt="">
</div>
</div>
<div class="comment-metadata">
<div class="media-body">
<p class="author_name">{$vo['author']}<span class="user-identity user-admin" title="{$vo['author']}"></span><span class="comment-from">@<a href="#comment-2264">{$field['author']}</a></span></p>
<div class="comment-text">
<p>{$vo['content']}</p>
</div>
</div>
<span class="comment-pub-time">{$vo.create_time}</span>
<span class="comment-btn-reply">
<a rel="nofollow" class="comment-reply-link" href="{$vo['reply_url']}" data-commentid="{$vo.id}" data-postid="{$apeField['id']}" data-belowelement="comment-{$vo.id}" data-respondelement="respond" data-replyto="回复给{$vo['author']}" aria-label="回复给{$vo['author']}"><i class="fa fa-reply"></i> 回复</a>
</span>
</div>
</div>
</li><!-- #comment-## -->
</ol><!-- .children -->
{/ape:comment}
</li><!-- #comment-## -->
{/ape:comment}
</ol>
<script type='text/javascript' src='__JS__/comment-reply.min.js'></script>
<script type='text/javascript'>
$("body").on("click", ".comment-reply-link",
function(e) {
addComment.moveForm("li-comment-" + $(this).attr("data-commentid"), $(this).attr("data-commentid"), "respond", $(this).attr("data-postid"));
console.log("li-comment-" + $(this).attr("data-commentid"), $(this).attr("data-commentid"), "respond", $(this).attr("data-postid"));
e.stopPropagation();
return false;
});
$(document).click(function(e) {
$(".conment-face-plane").css("opacity", "0");
$(".conment-face-plane").css("visibility", "hidden");
e.stopPropagation();
});
$("body").on("click", ".img-pace",
function(e) {
$(".comment_form_textarea").val($(".comment_form_textarea").val() + "[f=" + $(this).attr("facename") + "]");
});
$("body").on("click", ".popover-btn-face",
function(e) {
if ($(".conment-face-plane").css("visibility") == "visible") {
$(".conment-face-plane").css("opacity", "0");
$(".conment-face-plane").css("visibility", "hidden");
} else {
$(".conment-face-plane").css("opacity", "1");
$(".conment-face-plane").css("visibility", "visible");
}
e.stopPropagation();
});
</script>
<nav class="comment-navigation pages"></nav>
</div>
{/if}
</div>
<div class="sidebar">
<div class="sidebar-box-list">

View File

@ -37,7 +37,7 @@
<ul class="menu-mobile-header-list">
<li id="menu-item-0" class="menu-item menu-item-0"><a href="/" aria-current="page">首页</a></li>
{ape:channel type="all"}
<li id="menu-item-{$field.id}" class="menu-item {notempty name="field['child']"}menu-item-has-children{/notempty} {:IsActiveNav($cid,$field['id'])?'current-menu-item current_page_item':''} menu-item-{$field['id']}">
<li id="menu-item-{$field.id}" class="menu-item {notempty name="field['child']"}menu-item-has-children{/notempty} {:is_active_nav($cid,$field['id'])?'current-menu-item current_page_item':''} menu-item-{$field['id']}">
{notempty name="field['child']"}
<a href="#" aria-current="page">{$field['title']}</a>
{else /}
@ -46,7 +46,7 @@
{notempty name="field['child']"}
<ul class="sub-menu">
{ape:channel type="son" typeid="$field['id']" void="vo"}
<li id="menu-item-{$vo.id}" class="menu-item menu-item-{$vo.id} {:IsActiveNav($cid,$vo['id'])?'current-menu-item':''}">
<li id="menu-item-{$vo.id}" class="menu-item menu-item-{$vo.id} {:is_active_nav($cid,$vo['id'])?'current-menu-item':''}">
<a title="{$vo['title']}" aria-current="page" href="{$vo['url']}" {if $vo['link_str']} target="_blank"{/if}>{$vo['title']}</a>
</li>
{/ape:channel}
@ -85,7 +85,7 @@
<ul id="menu-header-list" class="menu-header-list">
<li class="menu-item menu-item-0"><a href="/">首页</a></li>
{ape:channel type="all"}
<li class="menu-item {notempty name="field['child']"}menu-item-has-children{/notempty} {:IsActiveNav($cid,$field['id'])?'current-menu-item':''} menu-item-{$field['id']}">
<li class="menu-item {notempty name="field['child']"}menu-item-has-children{/notempty} {:is_active_nav($cid,$field['id'])?'current-menu-item':''} menu-item-{$field['id']}">
{notempty name="field['child']"}
<a href="#" aria-current="page">{$field['title']}</a>
{else /}
@ -94,7 +94,7 @@
{notempty name="field['child']"}
<ul class="sub-menu">
{ape:channel type="son" typeid="$field['id']" void="vo"}
<li id="menu-item-{$vo.id}" class="menu-item menu-item-{$vo.id} {:IsActiveNav($cid,$vo['id'])?'current-menu-item':''}">
<li id="menu-item-{$vo.id}" class="menu-item menu-item-{$vo.id} {:is_active_nav($cid,$vo['id'])?'current-menu-item':''}">
<a title="{$vo['title']}" href="{$vo['url']}" {if $vo['link_str']} target="_blank"{/if}>{$vo['title']}</a>
</li>
{/ape:channel}