Beispiel #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;
     }
 }
Beispiel #2
0
 public function store()
 {
     global $ari;
     $is_new = true;
     if ($this->id > ID_UNDEFINED) {
         $is_new = false;
     }
     if (parent::store()) {
         // le mandamos una notificacion al destinatario de que lo estan siguiendo
         if ($is_new) {
             $notificacion = new perfil_notificacion();
             $notificacion->set('origen', $this->get('origen'));
             $notificacion->set('destino', $this->get('destino'));
             $notificacion->set('fecha', new Date());
             $notificacion->set('tipo', new perfil_notificacion_tipo(1));
             $notificacion->set('enviado', 0);
             $notificacion->store();
         }
         return true;
     } else {
         return false;
     }
 }
Beispiel #3
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");
Beispiel #4
0
 public function delete()
 {
     // cuando borramos  un mensaje, lo que hacemos es borrar todas las notificaciones relacionadas con ese mensaje.
     $id = $this->id();
     $filtro[] = array('value' => $id, 'field' => 'origen(perfil_mensaje)', 'type' => 'list');
     if ($notificaciones = perfil_notificacion::getFilteredList(0, 0, false, false, $filtro)) {
         foreach ($notificaciones as $notificacion) {
             $notificacion->delete();
         }
     }
     return parent::delete();
 }
Beispiel #5
0
    }
    if ($_POST['mensaje'] == '' && $_FILES['file']['name'] == '') {
        $mensaje->error()->addError('NO_MENSAJE');
    }
    if ($mensaje->store()) {
        header("Location: " . $ari->get('webaddress') . '/perfil/perfil/mio');
        exit;
    }
    $ari->t->assign("error", true);
    $errores = array();
    // errores del mensaje
    if ($e = $mensaje->error()->getErrors()) {
        $errores = array_merge($e, $errores);
    }
    if ($e = $up->error()->getErrors()) {
        $errores = array_merge($e, $errores);
    }
    var_dump($errores);
    foreach ($errores as $error) {
        $ari->t->assign($error, true);
    }
}
// mostramos los datos en la pantalla
// usuario
$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("novedades", perfil_notificacion::get_novedades_usuario());
$ari->t->display($ari->module->usertpldir() . DIRECTORY_SEPARATOR . "perfil_mio.tpl");