public function hook_timeline() { $type = "Text"; if (isset($_POST['send'])) { $result = $this->render_form_submit($type); $f = new PublicationObject(); $f->content = $result; $f->qrender = "Text"; $f->save(); } $form_publish = '<div class="actualite"> <div class="actualite_avatar_area"> <div class="actualite_avatar avatar" style="background-image:url(' . User::get_user_logged_avatar() . ')"> </div> </div> <div class="quoi_de_neuf_bloc"> <form method="POST" action="">' . $this->render_form($type) . ' <input type="submit" value="publier" name="send"/></form> <div style="position: absolute; display: none; word-wrap: break-word; white-space: pre-wrap; border-left: 0px none rgb(51, 51, 51); border-color: rgb(51, 51, 51); border-style: none; border-width: 0px; font-weight: 400; width: 510px; font-family: monospace; line-height: 14px; font-size: 12px; padding: 10px;"> </div></div> <div class="clear"></div> </div>'; $friendshipO = new FriendshipObject(); $friends = $friendshipO->loadAllFriends(User::get_user_logged_id()); $friends[] = user::get_user_logged_id(); $f = PublicationObject::loadAllByFriendship($friends); $content_publish = ""; $users = array(); $theme = new Theme(); foreach ($f as $t) { if (!isset($users[$t->author])) { $users[$t->author] = new UserObject(); $users[$t->author]->load($t->author); } $u = $users[$t->author]; $content_publish .= '<div class="actualite"> <div class="actualite_avatar_area"> <div class="actualite_avatar avatar" style="background-image:url(' . $u->get_avatar() . ')"> </div> <div class="actualite_nom">' . $theme::linking(Page::url("/profile/{$u->uid}"), $u->firstname . "<br />" . $u->lastname) . '</a></div> </div> <div class="actualite_bloc"> <div class="actualite_area"> <div class="actualite_area_text"> ' . $this->render_render($t->qrender, $t->content) . ' </div> </div> <div class="actualite_buttons"> <div class="actualite_date"><i class="fa fa-calendar fa-fw"></i> ' . date("H:i:s d/m/Y", $t->date_published) . '</div> <div class="clear"></div> </div> </div> <div class="clear"></div> </div>'; } return array($form_publish, '<div class="page_contenu_sep"></div>', $content_publish); }
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; }