Various improvements #51

Merged
MrPetovan merged 13 commits from master into master 2018-07-11 05:34:03 +02:00
2 changed files with 8 additions and 11 deletions
Showing only changes of commit 4de3fcf5f5 - Show all commits

View File

@ -230,13 +230,10 @@ CREATE TABLE IF NOT EXISTS `sync-timestamps` (
--
CREATE TABLE IF NOT EXISTS `tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`term` char(255) NOT NULL,
`nurl` char(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `term` (`term`(250)),
KEY `nurl` (`nurl`(250))
) ENGINE=MyISAM AUTO_INCREMENT=101679 DEFAULT CHARSET=utf8mb4;
`term` varchar(50) NOT NULL,
`profile_id` int(11) NOT NULL,
PRIMARY KEY (`term`,`profile_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------

View File

@ -39,8 +39,8 @@ function run_submit($url)
`updated` = '%s'
WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), intval($profile_id)
);
$r = q("DELETE FROM `tag` WHERE `nurl` = '%s'",
dbesc($r[0]['nurl'])
$r = q("DELETE FROM `tag` WHERE `profile_id` = %d",
intval($profile_id)
);
}
@ -188,9 +188,9 @@ function run_submit($url)
$t = substr($t, 0, 254);
if (strlen($t)) {
$r = q("INSERT INTO `tag` (`term`, `nurl`) VALUES ('%s', '%s') ",
$r = q("INSERT INTO `tag` (`term`, `profile_id`) VALUES ('%s', %d) ",
dbesc($t),
dbesc($nurl)
intval($profile_id)
);
}
}