public static function list_of_friends($id_user = null) { $friends = new FriendshipObject(); $output = ""; if ($id_user == null && ($u = User::get_user_logged_id()) != null) { $id_user = $u; } $theme = new Theme(); $theme->set_title(t("Liste des amis")); if ($tab = $friends->loadAllFriends($id_user)) { foreach ($tab as $k => $f) { $u = new UserObject(); $u->load($f); $output .= "<div class=\"friend_line\">"; $output .= "<div class=\"friend_line_avatar_area\">"; $output .= "<div class=\"friend_line_avatar avatar\" style=\"background-image:url(" . $u->get_avatar() . ");\">"; $output .= $theme->linking(Page::url("/profile/" . $f), ""); $output .= "</div>"; $output .= "</div>"; $output .= "<div class=\"friend_line_name_area\">"; $output .= "<div class=\"friend_line_name\">"; $output .= $theme->linking(Page::url("/profile/" . $f), $u->firstname . " " . $u->lastname); $output .= "<div class=\"friend_line_name_icon\">"; $output .= "<i class=\"fa fa-user fa-fw\"></i>"; $output .= "</div>"; $output .= "</div>"; $output .= "</div>"; $output .= "<div class=\"clear\"></div>"; $output .= "</div>"; } $theme->add_to_body($output); } else { Notification::statusNotify(t("Vous n'avez pas encore d'ami. " . $theme->linking(Page::url("/users"), t("Voir la liste des utilisateurs"))), Notification::STATUS_INFO); } $theme->process_theme(Theme::STRUCT_ADMIN); return; }
public static function page_profile($id_user = null) { $theme = new Theme(); $isMyProfil = false; if ($id_user == null) { $id_user = self::get_user_logged_id(); $isMyProfil = true; } $u = new UserObject(); $u->load($id_user); $url_avatar = $u->get_avatar(); $output = ""; $output .= "<div id=\"profil_top\">"; $output .= "<div id=\"profil_top_avatar\" class=\"avatar\" style=\"background-image:url({$url_avatar});\">"; if ($isMyProfil) { $output .= Theme::linking(Page::url("/profile/settings/avatar"), "<span id=\"profil_top_avatar_changeBG\"></span><span id=\"profil_top_avatar_changeTxt\">" . t("Modifier") . "</span>"); } $output .= "</div>"; $output .= "<div id=\"profil_top_avatar_nom\">"; if ($isMyProfil) { $output .= "<i class=\"fa fa-user fa-fw\" title=\"Mon profil\"></i>"; } $output .= $u->firstname . " " . $u->lastname; $output .= "</div>"; $output .= "</div>"; $output .= "<div class=\"page_contenu_sep\"></div>"; $output .= "<div id=\"profil_buttons\">"; $result = method_invoke_all("hook_profile_view", array($id_user)); foreach ($result as $r) { $output .= $r; } $output .= "<div class=\"clear\"></div>"; $output .= "</div>"; $theme->add_to_body($output); $theme->process_theme(Theme::STRUCT_DEFAULT); }
public function discussions() { if (User::get_user_logged_id() != null) { $messages = MessagesDB::getDiscussions(User::get_user_logged_id()); $theme = new Theme(); $theme->set_title(t("Messagerie")); foreach ($messages as $m) { $user = new UserObject(); $user->load($m->conversation); $messagetype = ""; if ($m->sid == $m->conversation && $m->read == 0) { $messagetype = '<div class="messagerie_bloc_icone"><i class="fa fa-envelope fa-fw" title="Message lu"></i></div>'; } else { if ($m->sid == $m->conversation && $m->read == 1) { $messagetype = '<div class="messagerie_bloc_icone"><i class="fa fa-envelope fa-fw" title="Message lu"></i></div>'; } elseif ($m->rid == $m->conversation && $m->read == 0) { $messagetype = '<div class="messagerie_bloc_icone"><i class="fa fa-reply fa-fw" title="Réponse envoyée"></i></div>'; } else { $messagetype = '<div class="messagerie_bloc_icone"><i class="fa fa-check fa-fw" title="Réponse envoyée et lu"></i></div>'; } } $theme->add_to_body('<div class="messagerie"> <div class="messagerie_avatar_area"> <div class="messagerie_avatar avatar" style="background-image:url(' . $user->get_avatar() . ')"> </div> <div class="messagerie_nom"><a>' . $user->firstname . ' <br/>' . $user->lastname . '</a></div> </div> <div class="messagerie_bloc ' . ($m->read == 0 && $m->sid == $m->conversation ? "messagerie_bloc_new" : "") . '" onclick="window.location.href=\'' . Page::url("/messages/" . $m->conversation) . '\'"> <div class="messagerie_bloc_informations"><span>' . $user->firstname . ' ' . $user->lastname . '</span> : <div class="messagerie_bloc_informations_date"><i class="fa fa-clock-o fa-fw"></i> ' . date(t("d-m-Y à H:i"), $m->sent_on) . '</div></div> <div class="messagerie_bloc_texte"> <div class="messagerie_bloc_texte_inside">' . $m->message . '</div> </div>' . $messagetype . '</div> <div class="clear"></div> </div>'); } $theme->process_theme(Theme::STRUCT_DEFAULT); } }