Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Echo Off
- CD /D "%~dp0"
- Set Path=%!!%Path%
- :: Settings
- Set Board=r34
- Set In=posts_%Board%.sql
- Set Out=edited_%In%
- Call :CreateDatabase >"%Out%"
- Call :DatabaseStructure >>"%Out%"
- For /F "eol= delims=" %%? In ('FindStr /BC:"(" "%In%"') Do (
- Set $Post=%%?
- Set "$Replace="
- For /F "eol= delims=" %%L In ('Set $Post^|grep -Eo "onclick=.highlight[^<>]*>[^<>]+"') Do (
- For /F "tokens=2 eol= delims='" %%N In ("%%L") Do (
- For /F "tokens=1,* delims==" %%A In ('Set $Post^|sed -r "s|(onclick=.highlightReply.''%%N''.;.)|class=''post-replyto'' data-replyto=''%%N'' \1|g"') Do (
- Echo %%B
- Set $Replace=true
- )
- )
- )
- Set $Replace >nul 2>nul||Echo %%?
- )>>"%Out%"
- Exit
- :CreateDatabase
- Echo. CREATE TABLE IF NOT EXISTS `posts_%Board%` (
- Echo. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- Echo. `thread` int(11) DEFAULT NULL,
- Echo. `subject` varchar(100) DEFAULT NULL,
- Echo. `email` varchar(30) DEFAULT NULL,
- Echo. `name` varchar(35) DEFAULT NULL,
- Echo. `trip` varchar(15) DEFAULT NULL,
- Echo. `capcode` varchar(50) DEFAULT NULL,
- Echo. `body` text NOT NULL,
- Echo. `body_nomarkup` text,
- Echo. `time` int(11) NOT NULL,
- Echo. `bump` int(11) DEFAULT NULL,
- Echo. `files` text,
- Echo. `num_files` int(11) DEFAULT '0',
- Echo. `filehash` text CHARACTER SET ascii,
- Echo. `password` varchar(20) DEFAULT NULL,
- Echo. `ip` varchar(39) CHARACTER SET ascii NOT NULL,
- Echo. `sticky` int(1) NOT NULL,
- Echo. `locked` int(1) NOT NULL,
- Echo. `sage` int(1) NOT NULL,
- Echo. `embed` text,
- Echo. `slug` varchar(256) DEFAULT NULL,
- Echo. `cutiemark` char(30) DEFAULT NULL,
- Echo. UNIQUE KEY `id` (`id`),
- Echo. KEY `thread_id` (`thread`,`id`),
- Echo. KEY `filehash` (`filehash`(40)),
- Echo. KEY `time` (`time`),
- Echo. KEY `ip` (`ip`),
- Echo. KEY `list_threads` (`thread`,`sticky`,`bump`)
- Echo.) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=51 ;
- Exit /B
- :DatabaseStructure
- Echo.
- Echo. INSERT INTO `posts_%Board%` (`id`, `thread`, `subject`, `email`, `name`, `trip`, `capcode`, `body`, `body_nomarkup`, `time`, `bump`, `files`, `num_files`, `filehash`, `password`, `ip`, `sticky`, `locked`, `sage`, `embed`, `slug`, `cutiemark`) VALUES
- Exit /B
Advertisement
Add Comment
Please, Sign In to add comment