& Matías Parodi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ## if (!defined("SECURITY")) { exit; } if ($_SESSION['LOGIN'] !== true) header("Location: {$base}home"); $id_group = safe_str($_GET['id'], true); $action = safe_str($_GET['action'], true); if ($action == 'config') { include('group_admin.php'); } else if ($action == 'members') { include('group_admin.php'); } else if (!empty($id_group)) { $sql = "SELECT `groups`.* FROM `groups` WHERE (`id_group` = '" . $id_group . "') LIMIT 1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); mysql_free_result($result); $id_group = $row['id_group']; $id_owner = $row['id_owner']; $name = $row['name']; $desc = $row['description']; $type = $row['type']; $sql = "SELECT `notes`.*, `users`.`avatar` FROM `notes` INNER JOIN `users` ON `users`.`id_user` = `notes`.`id_user` WHERE `notes`.`note` LIKE '#" . $group . " %' ORDER BY `notes`.`date` DESC LIMIT " . $CONFIG['NOTES_2p'] . ";"; $result = mysql_query($sql); if (mysql_affected_rows() != 0) { while ($row = mysql_fetch_assoc($result)) { $sql = "SELECT `suscriptions`.* FROM `suscriptions` WHERE ((`suscriptions`.`id_user` = '" . $_SESSION['ID_USER'] . "') AND (`suscriptions`.`id_group` = '" . $id_group . "')) LIMIT 1;"; $result = mysql_query($sql); if (mysql_affected_rows() != 0) { $sql = "SELECT `users`.* FROM `users` WHERE (`id_user` = '" . $row['id_user'] . "') LIMIT 1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); mysql_free_result($result); echo '
' . $row['note'] . '
'; echo '    
' . get_difference($row['date'], $get_difference_lang) . ' (' . $row['from'] . ')
'; } } } else { echo _('Grupo no encontrado.'); } } else { ?>

' . $row2['name'] . ' - ' . $row2['description'] . ' '; if ($row['level'] == 'admin') { echo '(admin)
'; } else { echo '
'; } } mysql_free_result($result); } else { echo _('No estás en ningún grupo.') . '

'; } ?>


' . $row['name'] . ' - ' . $row['description'] . ' (admin)
'; } } else { echo 'No tienes ningún grupo.
'; } echo ' ' . _('Crear grupo') . ''; ?>



' . $row['name'] . ' - ' . $row['description'] . '
'; /* $sql2 = "SELECT `suscriptions`.* FROM `suscriptions` WHERE (`id_user` = '" . $_SESSION['ID_USER'] . "');"; $result2 = mysql_query($sql2); $row2 = mysql_fetch_assoc($result2); mysql_free_result($result2); if ($row2['level'] == 'admin') { echo '(admin)
'; } else { echo '
'; } */ } mysql_free_result($result); } } ?>