• DEDECMS中直接通过数据库插入文章


    突然想用爬虫爬来的数据对接DEDECMS,所以研究了一下怎么直接在DEDECMS中直接插入一片文章

    (但其实我并没有这样用。因为我直接用前台做的网页,用ajax请求的json数据,其他的都简单,就是没办法人工审核内容)

    尝试了半天,其实只要操作下面三个表格即可。其中各个字段的意思,各位自己查吧。

    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (3, 2, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');
    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (4, 3, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');
    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (5, 3, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');
    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (6, 3, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');
    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (7, 4, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');
    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (8, 4, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');
    INSERT INTO `dede_addonarticle` (`aid`, `typeid`, `body`, `redirecturl`, `templet`, `userip`) VALUES (9, 4, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', '', '127.0.0.1');

    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(3, 2, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);
    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(4, 3, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);
    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(5, 3, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);
    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(6, 3, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);
    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(7, 4, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);
    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(8, 4, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);
    INSERT INTO `dede_archives` (`id`, `typeid`, `typeid2`, `sortrank`, `flag`, `ismake`, `channel`, `arcrank`, `click`, `money`, `title`, `shorttitle`, `color`, `writer`, `source`, `litpic`, `pubdate`, `senddate`, `mid`, `keywords`, `lastpost`, `scores`, `goodpost`, `badpost`, `voteid`, `notpost`, `description`, `filename`, `dutyadmin`, `tackid`, `mtype`, `weight`) VALUES(9, 4, '0', 1428895820, '', 1, 1, 0, 177, 0, '文章15', '', '', 'admin', '未知', '', 1428895820, 1428895835, 1, '文章,我是,文章,', 0, 0, 0, 0, 0, 0, '<object data="http://dlstatic.cdn.zhanqi.tv/assets/swf/chunk/v2/BFPlayer.swf', '', 1, 0, 0, 7);

    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (3, 2, '0', 0, 1, 1428897598, 1428897570, 1);
    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (4, 3, '0', 0, 1, 1428897598, 1428897570, 1);
    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (5, 3, '0', 0, 1, 1428897598, 1428897570, 1);
    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (6, 3, '0', 0, 1, 1428897598, 1428897570, 1);
    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (7, 4, '0', 0, 1, 1428897598, 1428897570, 1);
    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (8, 4, '0', 0, 1, 1428897598, 1428897570, 1);
    INSERT INTO `dede_arctiny` (`id`, `typeid`, `typeid2`, `arcrank`, `channel`, `senddate`, `sortrank`, `mid`) VALUES (9, 4, '0', 0, 1, 1428897598, 1428897570, 1);

  • 相关阅读:
    json转MAP
    责任链模式
    单例模式
    代理模式
    策略模式
    mysql触发器的使用
    Java 中的日期和时间
    MySQL插入数据前检测唯一性
    java字符串转为Map类型:split()方法的应用
    java Socket实例
  • 原文地址:https://www.cnblogs.com/bugutian/p/4798479.html
Copyright © 2020-2023  润新知