Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
Archivo: apps.php Proyecto: Mauru/red
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;
}
Ejemplo n.º 3
0
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;
}