& 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; } $page = safe_str($_GET['p']); if (empty($page)) { $page = '1'; } if ($page > 0) { $start_reg = ($page - 1) * $CONFIG['NOTES_2p']; } else { $start_reg = 0; } /* $sql = " SELECT `notes`.*, `users`.`avatar`, `users`.`username` FROM `notes` INNER JOIN `users` ON `users`.`id_user` = `notes`.`id_user` INNER JOIN `suscriptions` ON `suscriptions`.`id_user` = `notes`.`id_user` INNER JOIN `groups` ON `groups`.`id_group` = `suscriptions`.`id_group` WHERE ((`groups`.`type` != 'private') AND (`notes`.`type` != 'private')) ORDER BY `notes`.`date` DESC LIMIT " . $start_reg . ", " . $CONFIG['NOTES_2p'] . ";"; */ $sql = " SELECT `notes`.*, `users`.`avatar`, `users`.`username` FROM `notes` INNER JOIN `users` ON `users`.`id_user` = `notes`.`id_user` WHERE (`notes`.`type` IN('', 'reply', 'group')) ORDER BY `notes`.`date` DESC LIMIT " . $start_reg . ", " . $CONFIG['NOTES_2p'] . ";"; $result = mysql_query($sql); if (mysql_affected_rows() != 0) { echo '

'; if ($_SESSION['LOGIN'] === true) { do_note_form(); } while ($row = mysql_fetch_assoc($result)) { $note = html_entity_decode($row['note']); preg_match_all('/[^\s]{40,}/', $note, $matches); for ($i=0; $i" . $matches[2] . ""; case "/": return "" . $matches[2] . ""; case "_": return "" . $matches[2] . ""; case "-": return "" . $matches[2] . ""; } '), $note); $note = preg_replace('/(?:[\w^_]{3,}:\/\/)(?:(?:[\w^_]{2,}\.)?[\w\-]{2,}(?:\.[\w^_]{2,})+){1}[^\s\[\]\(\)<>,";\.]*(?:\.\w+)*[^\s\[\]\(\)<>,";\.]*/', '$0', $note); if ($row['twitter'] == 1) { $note = preg_replace('/(\s|\A)(@|!){1}(\w+)/', '$1$2$3', $note); } else { $note = preg_replace('/(\s|\A)(@|!){1}(\w+)/', '$1$2$3', $note); } $note = preg_replace($emoticons_shooter, $emoticons, $note); $avatar = 'images/avatar/' . $row['username'] . '/thumb_note.' . $row['avatar']; $avatar = (file_exists($avatar) === true) ? $avatar : 'images/avatar/default_note.png'; // echo ($row['type'] == 'group') ? '
' : '
'; if (($_SESSION['LOGIN'] === true) and ($_SESSION['USERNAME'] != $row['username'])) { echo (strstr(strtolower($row['to']), strtolower($_SESSION['USERNAME']))) ? '
' : '
'; } else { echo '
'; } echo '
'; if (!empty($row['attached_file'])) echo '[D] '; if (($_SESSION['LOGIN'] === true) and ($_SESSION['USERNAME'] == $row['username'])) echo ' '; if ($_SESSION['LOGIN'] === true) { $sql = "SELECT * FROM `favorites` WHERE (`permalink` = '" . $row['permalink'] . "') and (`id_user` = '" . $_SESSION['ID_USER'] . "');"; mysql_query($sql); if (mysql_affected_rows() == 0) { echo ' '; } else { echo ' '; } } if ($row['type'] != 'private') echo ''; if (($_SESSION['LOGIN'] === true) and ($row['id_user'] != $_SESSION['ID_USER'])) echo ' '; echo '
' . get_difference($row['date'], $get_difference_lang) . ' (' . $row['from'] . ')
' . $note . '
'; } mysql_free_result($result); echo ''; $sql = " SELECT COUNT(*) FROM `notes` WHERE (`notes`.`type` IN('', 'group', 'reply'));"; $result = mysql_query($sql); $row = mysql_fetch_array($result); mysql_free_result($result); if ($row[0] > $CONFIG['NOTES_2p']) { require("./includes/pagination_class.php"); $pagination = new pagination($page, $row[0], $CONFIG['NOTES_2p'], 'public' , $pagination_components_enabled, $pagination_components_text, $pagination_href, $pagination_classes, true); $result_pagination = $pagination->show_pagination(); echo '

'; } } else { echo '
' . _('No se encontraron notas públicas') . '
'; } ?>