function app_install($uid, $app) { $app['uid'] = $uid; if (app_installed($uid, $app)) { $x = app_update($app); } else { $x = app_store($app); } if ($x['success']) { $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($x['app_id']), intval($uid)); if ($r) { build_sync_packet($uid, array('app' => $r[0])); } return $x['app_id']; } return false; }
function app_install($uid, $app) { $app['uid'] = $uid; if (app_installed($uid, $app)) { $x = app_update($app); } else { $x = app_store($app); } if ($x['success']) { return $x['app_id']; } return false; }
function app_install($uid, $app) { $app['uid'] = $uid; if (app_installed($uid, $app)) { $x = app_update($app); } else { $x = app_store($app); } if ($x['success']) { $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($x['app_id']), intval($uid)); if ($r) { if (!$r[0]['app_system']) { if ($app['categories'] && !$app['term']) { $r[0]['term'] = q("select * from term where otype = %d and oid = d", intval(TERM_OBJ_APP), intval($r[0]['id'])); build_sync_packet($uid, array('app' => $r[0])); } } } return $x['app_id']; } return false; }