# # 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 . global $_USER; global $db; $params = PARAMS; if (defined('SEEING_PROFILE')) { global $_PROFILE; $userInfo = $_PROFILE; $user = SEEING_PROFILE; $id = $_PROFILE['ID']; $profile = true; $external = true; } elseif ($_USER) { $profile = true; if (MODULE != 'tag' || (MODULE == 'tag' && (!$params))) { $userInfo = $_USER; $user = $_USER['username']; $id = $_USER['ID']; } else $tags = true; } else { if (MODULE == 'tag') { if (strlen($params) > 0) { $profile = true; $tags = true; } else $profile = true; } else $profile = false; } if ($profile == true) { echo '
'; if (!$tags) { if (!$userInfo['avatar']) $avatar = BASE.'static/img/avatar/default_side.png'; else $avatar = get_avatar_url($user, $userInfo['avatar'], 'side'); echo ''.__('Avatar').'
'.$user.'
'; } else echo ' #'.utf8_htmlentities(PARAMS).'
'; if ($external == true) { if ($_USER && $_USER['ID'] != $_PROFILE['ID']) { $me = $_USER['username']; $currentUserID = $_USER['ID']; $follows = $db->checkFollowing($currentUserID, $id); if ($follows) { $button_text = __('Unfollow'); } else { $button_text = __('Follow'); } $sbtn = 'action'.md5($userInfo['ID']); $ignores = in_array($userInfo['ID'], $_USER['ignored']); echo '
'; $btn = 'action_ignore'.md5($userInfo['ID']); if($ignores) { $ignore_text = __('Unignore'); } else { $ignore_text = __('Ignore'); } echo '

'.__('Report').''; } } if (!$tags) extract($userInfo); echo '
'.__('About').' '.__('About').'
'; if (!$tags) { if ($realname) echo ''.__('Name').' '.utf8_htmlentities($realname).'
'; if ($location) echo ''.__('Location').' '.utf8_htmlentities($location).'
'; if ($url) echo ''.__('Webpage').' '.str_replace(array('www.', 'http://'), '', utf8_htmlentities($url)).'
'; if ($bio) echo ''.__('Bio').' '.utf8_htmlentities($bio).'
'; } else $options = $db->getInfoTag(PARAMS, true); if (!$tags) echo ''.__('Since').' '.date('d/m/Y', $since); else { if (!$options['since']) $since = 'never'; else $since = date('d/m/Y', $options['since']); echo ''.__('First note').' '.$since; if ($options['founder']) echo '
'.__('First poster').' '.$options['founder'].''; } echo '
'; if ($external == true) { $calc = time() - $last_seen; if ($calc < 300) $content = __('online'); else { if ($calc < 3600) { $string = round($calc / 60); $content = str_replace('%s', $string, __('%s minutes ago')); } elseif ($calc < 86400) { $string = round($calc / 3600); if ($string == 1) $content = str_replace('%s', $string, __('%s hour ago')); else $content = str_replace('%s', $string, __('%s hours ago')); } elseif ($calc < 2678400) { $string = round($calc / 86400); if ($string == 1) $content = str_replace('%s', $string, __('%s day ago')); else $content = str_replace('%s', $string, __('%s days ago')); } else { $content = __('more than 1 month'); } } echo ''.__('Activity').' '.$content.'
'; } if (!$tags) { $following = $db->countFollowing($ID); $followers = $db->countFollowers($ID); $favorites = $db->countNotes('favorites', $ID); $privates = $db->countNotes('private', $username); $notes = $db->countNotes('archive', $ID); } else { $notes = $db->countNotes('tag', PARAMS); } echo '
'; echo '
'.__('Stats').' '.__('Stats').'
'; echo '
'; if (!$tags) { echo ''; if ($external == true) echo ''; else echo ''; echo __('Following').' '.$following.'
'; echo ''; if ($external == true) { if ($show_followers) echo ''; } else echo ''; echo __('Followers'); if ($external == true) { if ($show_followers) echo ''; } else echo ''; echo ' '.$followers.'
'; echo ''; if ($external == true) echo ''; else echo ''; echo __('Favorites').' '.$favorites.'
'; if (!$external) { echo ''.__('Private').' '.$privates; if($unread_privates) echo ' ('.$unread_privates.')'; echo '
'; } } echo ''.__('Notes').' '.$notes.''; if ($tags) { $w_rate = round(($notes / (time() - $options['since']) * 60), 2); echo '
'.__('Writing rate').' '.$w_rate.'/minute'; if ($options['max_poster_username']) echo '
'.__('Max. poster').' '.$options['max_poster_username'].' ('.$options['max_poster_quantity'].' '.__('notes').')'; } echo '
'; $result = $db->getFollowing($ID, 0, 25); if (count($result) > 0) { echo '
'.__('Following').' '.__('Following').'
'; foreach ($result as $follower) showFollower($follower); if (count($result) > 24) { echo '
'; if ($external == true) echo ''; else echo ''; echo __('more').' »'; } echo '
'; } $query = $db->send("SELECT `tag`, COUNT(`id`) FROM tags_n WHERE (UNIX_TIMESTAMP() - `timestamp`) < 86400 GROUP BY `tag` ORDER BY COUNT(`id`) DESC LIMIT 5"); echo '
'.__('Most used tags').' '.__('Today most used tags').'
'; while ($row = mysql_fetch_row($query)) { echo '#'.$row[0].'
'; } echo '
'.__('more').' »
'; if (defined('USE_INVITATION')) { if ((USE_INVITATION == true) && ($_USER['invitations'] > 0) && (!$external)) { echo '
'.__('Invitations').'
'; echo '
'; echo '
'; echo '

'; echo '

'.$_USER['invitations'].' '.__('invitations left').'

'; echo '
'; echo '
'; } } } else { doLoginForm(); } if ($_PROFILE['private'] != 1 && $_USER['private'] != 1) { echo '
'.__('RSS').'
'; echo '
'; echo '
'; } ?>