& 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; } $username = safe_str($_GET['username']); $page = safe_str($_GET['p']); if (empty($page)) { $page = '1'; } if ($page > 0) { $start_reg = ($page - 1) * $CONFIG['NOTES_2p']; } else { $start_reg = 0; } if (($_SESSION['LOGIN'] === true) and ($_SESSION['USERNAME'] == $username)) { $sql = " SELECT `users`.`id_user` FROM `users` WHERE (`users`.`username` = '" . $username . "') LIMIT 1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); mysql_free_result($result); $id_user = $row[0]; $sql = " SELECT `users`.* FROM `users` INNER JOIN `followers` ON `users`.`id_user` = `followers`.`id_user` WHERE (`followers`.`id_follower` = '" . $id_user . "') ORDER BY `followers`.`id_follow` DESC LIMIT " . $start_reg . ", " . $CONFIG['NOTES_2p'] . ";"; $result = mysql_query($sql); if (mysql_affected_rows() != 0) { echo '

'; while ($row = mysql_fetch_assoc($result)) { $avatar = 'images/avatar/' . $row['username'] . '/thumb_note.' . $row['avatar']; $avatar = (file_exists($avatar) === true) ? $avatar : 'images/avatar/default_note.png'; echo '
'; if (($_SESSION['LOGIN'] === true) and ($row['username'] != $_SESSION['USERNAME'])) { $sql = "SELECT * FROM `followers` WHERE ((`followers`.`id_user` = '" . $_SESSION['ID_USER'] . "') AND (`followers`.`id_follower` = '" . $row['id_user'] . "')) LIMIT 1;"; $result_follower = mysql_query($sql); $row_follower = mysql_fetch_assoc($result_follower); mysql_free_result($result_follower); if (mysql_affected_rows() == 0) { echo '
'; } else { echo '
'; } } echo '
'; } mysql_free_result($result); $sql = " SELECT COUNT(*) FROM `followers` WHERE (`followers`.`id_follower` = '" . $id_user . "');"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); mysql_free_result($result); if ($row[0] > $CONFIG['NOTES_2p']) { $pagination_href = array ("username" => $username, "p" => "[-]"); require("./includes/pagination_class.php"); $pagination = new pagination($page, $row[0], $CONFIG['NOTES_2p'], 'followers', $pagination_components_enabled, $pagination_components_text, $pagination_href, $pagination_classes, true); $result_pagination = $pagination->show_pagination(); echo '

'; } } else { echo '
' . _('No hay ningún seguidor para este usuario') . '
'; } } else { header('Location: ' . $_SERVER['HTTP_REFERER']); } ?>