#
# 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 '

'.__('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').'
';
echo '';
$result = $db->getFollowing($ID, 0, 25);
if (count($result) > 0) {
echo '
'.__('Following').'
';
}
$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 '
'.__('Today most used tags').'
';
if (defined('USE_INVITATION')) {
if ((USE_INVITATION == true) && ($_USER['invitations'] > 0) && (!$external)) {
echo ''.__('Invitations').'
';
echo '';
}
}
}
else {
doLoginForm();
}
if ($_PROFILE['private'] != 1 && $_USER['private'] != 1) {
echo ''.__('RSS').'
';
echo '';
}
?>