Now we have less than 100 insert commands, yeah

This commit is contained in:
Michael 2017-08-09 23:02:57 +00:00
parent c6b04aa922
commit 03b86d3766
6 changed files with 14 additions and 40 deletions

View file

@ -46,13 +46,10 @@ function install_plugin($plugin) {
$func = $plugin . '_install';
$func();
$plugin_admin = (function_exists($plugin."_plugin_admin")?1:0);
$plugin_admin = (function_exists($plugin."_plugin_admin") ? 1 : 0);
$r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`, `plugin_admin`) VALUES ( '%s', 1, %d , %d ) ",
dbesc($plugin),
intval($t),
$plugin_admin
);
dba::insert('addon', array('name' => $plugin, 'installed' => true,
'timestamp' => $t, 'plugin_admin' => $plugin_admin));
// we can add the following with the previous SQL
// once most site tables have been updated.
@ -154,12 +151,8 @@ function register_hook($hook,$file,$function,$priority=0) {
if (dbm::is_result($r))
return true;
$r = q("INSERT INTO `hook` (`hook`, `file`, `function`, `priority`) VALUES ( '%s', '%s', '%s', '%s' ) ",
dbesc($hook),
dbesc($file),
dbesc($function),
dbesc($priority)
);
$r = dba::insert('hook', array('hook' => $hook, 'file' => $file, 'function' => $function, 'priority' => $priority));
return $r;
}}