Esempio n. 1
0
 public function store()
 {
     $is_new = true;
     if ($this->id > ID_UNDEFINED) {
         $is_new = false;
     }
     if (parent::store()) {
         if (!$is_new) {
             // para cada seguidor no bloqueado, crear notificacion, el usuario ha actualizado sus datos de perfil.
             if ($amigos = perfil_amigo::get_todos_mis_seguidores()) {
                 foreach ($amigos as $amigo) {
                     if ($amigo->get('bloqueo_destino') == false) {
                         $notificacion = new perfil_notificacion();
                         $notificacion->set('origen', $this);
                         $notificacion->set('destino', $amigo->get('origen'));
                         $notificacion->set('fecha', new Date());
                         $notificacion->set('tipo', new perfil_notificacion_tipo(2));
                         $notificacion->set('enviado', 0);
                         $notificacion->store();
                     }
                 }
             }
         }
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 public function store()
 {
     if (parent::store()) {
         // para cada amigo que no tenga bloqueado, crear una notificacion de que escribí el mensaje.
         if ($amigos = perfil_amigo::get_todos_mis_seguidores()) {
             foreach ($amigos as $amigo) {
                 if ($amigo->get('bloqueo_destino') == false) {
                     $notificacion = new perfil_notificacion();
                     $notificacion->set('origen', $this);
                     $notificacion->set('destino', $amigo->get('origen'));
                     // al que lo origina, por eso es un seguidor!
                     $notificacion->set('fecha', new Date());
                     // si el usuario está tagueado en la foto, mandar un mensaje adicional.
                     $notificacion->set('tipo', new perfil_notificacion_tipo(3));
                     $notificacion->set('enviado', 0);
                     $notificacion->store();
                 }
             }
         }
         // lo agregamos para que salga en nuestro propio timeline.
         $notificacion = new perfil_notificacion();
         $notificacion->set('origen', $this);
         $notificacion->set('destino', $this->get('perfil'));
         $notificacion->set('fecha', new Date());
         $notificacion->set('tipo', new perfil_notificacion_tipo(3));
         $notificacion->set('enviado', 1);
         $notificacion->store();
         return true;
     } else {
         return false;
     }
 }
Esempio n. 3
0
<?php

global $ari;
$ari->popup = true;
$handle = $ari->url->getVars();
// handle 2
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
}
$destino = new perfil_perfil($handle[2]);
$amigo = new perfil_amigo();
$amigo->set('origen', $perfil);
$amigo->set('destino', $destino);
$amigo->set('fecha', new Date());
if ($amigo->store()) {
    echo 'agregado';
    exit;
}
echo 'no se puede agregar';
exit;
Esempio n. 4
0
<?php

global $ari;
$plantilla = $ari->newTemplate();
$plantilla->caching = 0;
$plantilla->force_compile = true;
$modulo = new oob_module('perfil');
$limit = 4 * 8 - 1;
// dejamos un lugar para el link.
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
        $plantilla->assign("amigos", perfil_amigo::get_mis_amigos_bloque($limit));
        $plantilla->display($modulo->usertpldir() . DIRECTORY_SEPARATOR . "bl_amigos.tpl");
    }
}
Esempio n. 5
0
<?php

global $ari;
$ari->t->force_compile = true;
$ari->t->cache = false;
$ct = new OOB_cleantext();
$limit = 20;
if (!isset($_GET['pos']) || !oob_validatetext::isNumeric($_GET['pos'])) {
    $_GET['pos'] = 0;
}
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
} else {
    seguridad::requireLogin();
}
// mostramos los datos en la pantalla
$ari->t->assign("nombre", $perfil->name());
$ari->t->assign("telefono", $ct->dropHTML($perfil->get('telefono')));
$ari->t->assign("bio", $ct->dropHTML($perfil->get('bio')));
$ari->t->assign("url", $ct->dropHTML($perfil->get('url')));
$ari->t->assign("foto", $perfil->foto());
$ari->t->assign("amigos", perfil_amigo::get_mis_amigos($_GET['pos']));
$ari->t->assign("amigos_count", perfil_amigo::get_mis_amigos_count());
$ari->t->assign("limit", $limit);
$ari->t->display($ari->module->usertpldir() . DIRECTORY_SEPARATOR . "perfil_amigos.tpl");
Esempio n. 6
0
// perfil del usuario
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil_usuario = $perfil_existente[0];
    }
}
if (!isset($handle[2]) || !oob_validatetext::isNumeric($handle[2])) {
    $perfil = $perfil_usuario;
} else {
    $perfil = new perfil_perfil($handle[2]);
}
// mostramos los datos en la pantalla
$ari->t->assign("nombre", $perfil->name());
$ari->t->assign("id_perfil", $perfil->id());
$ari->t->assign("telefono", $ct->dropHTML($perfil->get('telefono')));
$ari->t->assign("bio", $ct->dropHTML($perfil->get('bio')));
$ari->t->assign("url", $ct->dropHTML($perfil->get('url')));
$ari->t->assign("foto", $perfil->foto());
if (isset($perfil_usuario) && $perfil_usuario->id() != $perfil->id()) {
    if (!perfil_amigo::es_amigo($perfil_usuario, $perfil)) {
        $es_amigo = false;
    }
}
$ari->t->assign("es_amigo", $es_amigo);
$ari->t->assign("timeline", perfil_notificacion::get_timeline($perfil, $_GET['pos']));
$ari->t->assign("timeline_count", perfil_notificacion::get_timeline_count($perfil));
$ari->t->assign("limit", $limit);
$ari->t->display($ari->module->usertpldir() . DIRECTORY_SEPARATOR . "perfil_ver.tpl");
Esempio n. 7
0
<?php

global $ari;
$ari->popup = true;
$handle = $ari->url->getVars();
// handle 2
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
}
$amigo = new perfil_amigo($handle[2]);
if ($amigo->get('destino')->id() == $perfil->id()) {
    $amigo->set('bloqueo_destino', 0);
    if ($amigo->store()) {
        echo 'activado';
        exit;
    }
}
echo 'no se puede activar';
exit;
Esempio n. 8
0
<?php

global $ari;
$ari->t->force_compile = true;
$ari->t->cache = false;
$ct = new OOB_cleantext();
$limit = 20;
if (!isset($_GET['pos']) || !oob_validatetext::isNumeric($_GET['pos'])) {
    $_GET['pos'] = 0;
}
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
} else {
    seguridad::requireLogin();
}
// mostramos los datos en la pantalla
$ari->t->assign("nombre", $perfil->name());
$ari->t->assign("telefono", $ct->dropHTML($perfil->get('telefono')));
$ari->t->assign("bio", $ct->dropHTML($perfil->get('bio')));
$ari->t->assign("url", $ct->dropHTML($perfil->get('url')));
$ari->t->assign("foto", $perfil->foto());
$ari->t->assign("seguidores", perfil_amigo::get_mis_seguidores($_GET['pos']));
$ari->t->assign("seguidores_count", perfil_amigo::get_mis_seguidores_count());
$ari->t->assign("limit", $limit);
$ari->t->display($ari->module->usertpldir() . DIRECTORY_SEPARATOR . "perfil_seguidores.tpl");
Esempio n. 9
0
<?php

global $ari;
$ari->popup = true;
$handle = $ari->url->getVars();
// handle 2
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
}
// buscamos el objeto de relacion de esta amistad a punto de morir.
$destino = new perfil_perfil($handle[2]);
if ($amistad = perfil_amigo::es_amigo($perfil, $destino)) {
    foreach ($amistad as $amigo) {
        $amigo->delete();
    }
    echo 'borrado';
    exit;
}
echo 'no se pudo borrar';
exit;