$search = '/\[url\=(.*?)\]\[!#saved_image([0-9]*)#!\]\[\/url\]' . '/is';
$replace = '[url=' . DI::baseUrl() . '/redir/' . $cid
- . '?f=1&url=' . '$1' . '][!#saved_image' . '$2' .'#!][/url]';
+ . '?url=' . '$1' . '][!#saved_image' . '$2' .'#!][/url]';
$newbody .= substr($origbody, 0, $pos['start']['open']);
$subject = substr($origbody, $pos['start']['open'], $pos['end']['close'] - $pos['start']['open']);
}
if ($cid && !$item['self']) {
- $poke_link = 'poke/?f=&c=' . $cid;
+ $poke_link = 'poke?c=' . $cid;
$contact_url = 'contact/' . $cid;
$posts_link = 'contact/' . $cid . '/posts';
switch ($destination_url) {
case 'profile':
- DI::baseUrl()->redirect('profile/' . $profile . '?f=&tab=profile');
+ DI::baseUrl()->redirect('profile/' . $profile . '?tab=profile');
break;
case 'photos':
DI::baseUrl()->redirect('photos/' . $profile);
DI::baseUrl()->redirect('profile/' . $profile);
break;
default:
- $appendix = (strstr($destination_url, '?') ? '&f=&redir=1' : '?f=&redir=1');
+ $appendix = (strstr($destination_url, '?') ? '&redir=1' : '?redir=1');
DI::baseUrl()->redirect($destination_url . $appendix);
break;
}
}
if (!$update) {
- $o .= "<script> var netargs = '?f=&item_id=" . $item_id . "'; </script>";
+ $o .= "<script> var netargs = '?item_id=" . $item_id . "'; </script>";
}
$o .= conversation($a, [$item], new Pager(DI::args()->getQueryString()), 'display', $update_uid, false, 'commented', $item_uid);
// last selected tab is _not_ '/network?order=activity'.
// and this isn't a date query
- $tab_baseurls = [
- '', //all
- '', //postord
- '', //conv
- '/new', //new
- '', //starred
- '', //bookmarked
- ];
$tab_args = [
'order=activity', //all
'order=post', //postord
'conv=1', //conv
- '', //new
+ 'new=1', //new
'star=1', //starred
'bmark=1', //bookmarked
];
$k = array_search('active', $last_sel_tabs);
if ($k != 3) {
- $net_baseurl .= $tab_baseurls[$k];
-
// parse out tab queries
$dest_qa = [];
$dest_qs = $tab_args[$k];
* '/network?order=activity' => $activity_active = 'active'
* '/network?order=post' => $postord_active = 'active'
* '/network?conv=1', => $conv_active = 'active'
- * '/network/new', => $new_active = 'active'
+ * '/network?new=1', => $new_active = 'active'
* '/network?star=1', => $starred_active = 'active'
* '/network?bmark=1', => $bookmarked_active = 'active'
*
$conv_active = '';
$postord_active = '';
- if (($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new')) {
+ if (!empty($_GET['new'])) {
$new_active = 'active';
}
$arr = ['query' => DI::args()->getQueryString()];
Hook::callAll('network_content_init', $arr);
- $flat_mode = false;
-
- if ($a->argc > 1) {
- for ($x = 1; $x < $a->argc; $x ++) {
- if ($a->argv[$x] === 'new') {
- $flat_mode = true;
- }
- }
- }
-
- if (!empty($_GET['file'])) {
- $flat_mode = true;
- }
-
- if ($flat_mode) {
+ if (!empty($_GET['new']) || !empty($_GET['file'])) {
$o = networkFlatView($a, $update);
} else {
$o = networkThreadedView($a, $update, $parent);
$cmd = DI::args()->getCommand();
+ $def_param = [];
+ if (!empty($_GET['cid'])) {
+ $def_param['cid'] = $_GET['cid'];
+ }
+
// tabs
$tabs = [
[
'label' => L10n::t('Latest Activity'),
- 'url' => str_replace('/new', '', $cmd) . '?order=activity' . (!empty($_GET['cid']) ? '&cid=' . $_GET['cid'] : ''),
+ 'url' => $cmd . '?' . http_build_query(array_merge($def_param, ['order' => 'activity'])),
'sel' => $all_active,
'title' => L10n::t('Sort by latest activity'),
'id' => 'activity-order-tab',
],
[
'label' => L10n::t('Latest Posts'),
- 'url' => str_replace('/new', '', $cmd) . '?order=post' . (!empty($_GET['cid']) ? '&cid=' . $_GET['cid'] : ''),
+ 'url' => $cmd . '?' . http_build_query(array_merge($def_param, ['order' => 'post'])),
'sel' => $post_active,
'title' => L10n::t('Sort by post received date'),
'id' => 'post-order-tab',
],
];
- $parameters = ['conv' => true];
- if (!empty($_GET['cid'])) {
- $parameters['cid'] = $_GET['cid'];
- }
-
$tabs[] = [
'label' => L10n::t('Personal'),
- 'url' => str_replace('/new', '', $cmd) . '?' . http_build_query($parameters),
+ 'url' => $cmd . '?' . http_build_query(array_merge($def_param, ['conv' => true])),
'sel' => $conv_active,
'title' => L10n::t('Posts that mention or involve you'),
'id' => 'personal-tab',
];
if (Feature::isEnabled(local_user(), 'new_tab')) {
- if (!empty($_GET['cid'])) {
- $query = '?' . http_build_query(['cid' => $_GET['cid']]);
- } else {
- $query = '';
- }
-
$tabs[] = [
'label' => L10n::t('New'),
- 'url' => 'network/new' . $query,
+ 'url' => $cmd . '?' . http_build_query(array_merge($def_param, ['new' => true])),
'sel' => $new_active,
'title' => L10n::t('Activity Stream - by date'),
'id' => 'activitiy-by-date-tab',
}
if (Feature::isEnabled(local_user(), 'link_tab')) {
- $parameters = ['bmark' => true];
- if (!empty($_GET['cid'])) {
- $parameters['cid'] = $_GET['cid'];
- }
-
$tabs[] = [
'label' => L10n::t('Shared Links'),
- 'url' => str_replace('/new', '', $cmd) . '?' . http_build_query($parameters),
+ 'url' => $cmd . '?' . http_build_query(array_merge($def_param, ['bmark' => true])),
'sel' => $bookmarked_active,
'title' => L10n::t('Interesting Links'),
'id' => 'shared-links-tab',
];
}
- $parameters = ['tar' => true];
- if (!empty($_GET['cid'])) {
- $parameters['cid'] = $_GET['cid'];
- }
-
$tabs[] = [
'label' => L10n::t('Starred'),
- 'url' => str_replace('/new', '', $cmd) . '?' . http_build_query($parameters),
+ 'url' => $cmd . '?' . http_build_query(array_merge($def_param, ['star' => true])),
'sel' => $starred_active,
'title' => L10n::t('Favourite Posts'),
'id' => 'starred-posts-tab',
$tags = ((!empty($_REQUEST['tags']))
? '&tags=' . urlencode(Strings::escapeTags(trim($_REQUEST['tags']))) : '');
- $s = Network::fetchUrl(DI::baseUrl() . '/parse_url?f=&url=' . $url . $title . $description . $tags);
+ $s = Network::fetchUrl(DI::baseUrl() . '/parse_url?url=' . $url . $title . $description . $tags);
if (!strlen($s)) {
return;
if ($order_field === 'posted') {
$order = [L10n::t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album), 'oldest'];
} else {
- $order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted', 'newest'];
+ $order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?order=posted', 'newest'];
}
$photos = [];
'id' => $rr['id'],
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
- . ($order_field === 'posted' ? '?f=&order=posted' : ''),
+ . ($order_field === 'posted' ? '?order=posted' : ''),
'title' => L10n::t('View Photo'),
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
'alt' => $imgalt_e,
}
if (!is_null($prv)) {
- $prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . ($order_field === 'posted' ? '?f=&order=posted' : '');
+ $prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . ($order_field === 'posted' ? '?order=posted' : '');
}
if (!is_null($nxt)) {
- $nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . ($order_field === 'posted' ? '?f=&order=posted' : '');
+ $nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . ($order_field === 'posted' ? '?order=posted' : '');
}
$tpl = Renderer::getMarkupTemplate('photo_edit_head.tpl');
$photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> L10n::t('View Full Size'),
- 'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . DateTimeFormat::utcNow('ymdhis'),
+ 'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?_u=' . DateTimeFormat::utcNow('ymdhis'),
'height' => $hires['height'],
'width' => $hires['width'],
'album' => $hires['album'],
$categories[] = [
'name' => $savedFolderName,
'url' => $url,
- 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&cat=' . rawurlencode($savedFolderName) : ""),
+ 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : ""),
'first' => $first,
'last' => false
];
$folders[] = [
'name' => $savedFolderName,
'url' => "#",
- 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&term=' . rawurlencode($savedFolderName) : ""),
+ 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : ""),
'first' => $first,
'last' => false
];
// The following nav links are only show to logged in users
if (local_user()) {
$nav['network'] = ['network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
- $nav['net_reset'] = ['network/?f=', L10n::t('Network Reset'), '', L10n::t('Load Network page with no filters')];
$nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')];
match: /(^|\s)(\#)([^ \n]{2,})$/,
index: 3,
search: function(term, callback) {
- $.getJSON(baseurl + '/hashtag/' + '?f=&t=' + term)
+ $.getJSON(baseurl + '/hashtag/' + '?t=' + term)
.done(function(data) {
callback($.map(data, function(entry) {
// .toLowerCase() enables case-insensitive search
tags = {
match: /(^|\s)(\#)([^ \n]{2,})$/,
index: 3,
- search: function(term, callback) { $.getJSON(baseurl + '/hashtag/' + '?f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
+ search: function(term, callback) { $.getJSON(baseurl + '/hashtag/' + '?t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
replace: function(item) { return "$1$2" + item.text; },
template: tag_format
};
function NavUpdate() {
if (!stopped) {
- var pingCmd = 'ping?format=json' + ((localUser != 0) ? '&f=&uid=' + localUser : '');
+ var pingCmd = 'ping?format=json' + ((localUser != 0) ? '&uid=' + localUser : '');
$.get(pingCmd, function(data) {
if (data.result) {
// send nav-update event
function previewTheme(elm) {
theme = $(elm).val();
- $.getJSON('pretheme?f=&theme=' + theme,function(data) {
+ $.getJSON('pretheme?theme=' + theme,function(data) {
$('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
});
function frio_item_photo_menu(App $a, &$arr)
{
foreach ($arr['menu'] as $k => $v) {
- if (strpos($v, 'poke/?f=&c=') === 0 || strpos($v, 'message/new/') === 0) {
+ if (strpos($v, 'poke?c=') === 0 || strpos($v, 'message/new/') === 0) {
$v = 'javascript:addToModal(\'' . $v . '\'); return false;';
$arr['menu'][$k] = $v;
}
// Add to pm and poke links a new key with the value 'modal'.
// Later we can make conditions in the corresponing templates (e.g.
// contact_template.tpl)
- if (strpos($pokelink, 'poke/?f=&c=' . $cid) !== false) {
+ if (strpos($pokelink, 'poke?c=' . $cid) !== false) {
$args['menu']['poke'][3] = 'modal';
}