diff --git a/boot.php b/boot.php index 5ba3b1b4a1..0bd201a253 100644 --- a/boot.php +++ b/boot.php @@ -1494,11 +1494,13 @@ function get_my_url() { return false; } -function zrl($s) { +function zrl($s,$force = false) { if(! strlen($s)) return $s; - if(! strpos($s,'/profile/')) + if((! strpos($s,'/profile/')) && (! $force)) return $s; + if($force && substr($s,-1,1) !== '/') + $s = $s . '/'; $achar = strpos($s,'?') ? '&' : '?'; $mine = get_my_url(); if($mine and ! link_compare($mine,$s)) diff --git a/include/items.php b/include/items.php index 05c0d50169..85df340d3f 100644 --- a/include/items.php +++ b/include/items.php @@ -19,9 +19,15 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) $converse = true; if($a->argv[$x] == 'starred') $starred = true; + if($a->argv[$x] === 'category' && $a->argc > ($x + 1) && strlen($a->argv[$x+1])) + $category = $a->argv[$x+1]; } + + } + + // default permissions - anonymous user $sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' "; @@ -101,6 +107,10 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) if(! strlen($last_update)) $last_update = 'now -30 days'; + if(x($category)) { + $sql_extra .= file_tag_file_query('item',$category,'category'); + } + if($public_feed) { if(! $converse) $sql_extra .= " AND `contact`.`self` = 1 "; diff --git a/index.php b/index.php index 5dd93523e3..442173eeb8 100644 --- a/index.php +++ b/index.php @@ -40,8 +40,8 @@ load_translation_table($lang); require_once("dba.php"); if(! $install) { -$db = new dba($db_host, $db_user, $db_pass, $db_data, $install); - unset($db_host, $db_user, $db_pass, $db_data); + $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); + unset($db_host, $db_user, $db_pass, $db_data); /** * Load configs from db. Overwrite configs from .htconfig.php @@ -95,6 +95,10 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { if(x($_GET,'zrl')) { $_SESSION['my_url'] = $_GET['zrl']; $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string); + if(! $install) { + $arr = array('zrl' => $_SESSION['my_url'], 'url' => $a->cmd); + call_hooks('zrl_init',$arr); + } } /** diff --git a/mod/directory.php b/mod/directory.php index 7f18bd0268..3674388454 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -44,7 +44,7 @@ function directory_content(&$a) { $gdirpath = dirname(get_config('system','directory_submit_url')); if(strlen($gdirpath)) { $globaldir = ''; + . zrl($gdirpath,true) . '">' . t('Global Directory') . ''; } $admin = ''; diff --git a/mod/randprof.php b/mod/randprof.php index 53d7425e96..6713a81d9e 100644 --- a/mod/randprof.php +++ b/mod/randprof.php @@ -5,6 +5,6 @@ function randprof_init(&$a) { require_once('include/Contact.php'); $x = random_profile(); if($x) - goaway($x); + goaway(zrl($x)); goaway($a->get_baseurl() . '/profile'); } diff --git a/view/auto_request.tpl b/view/auto_request.tpl index 2958397c92..961de9bb39 100644 --- a/view/auto_request.tpl +++ b/view/auto_request.tpl @@ -7,7 +7,7 @@ $page_desc
  • $friendica
  • $diaspora $diasnote
  • $statusnet
  • -
  • $emailnet
  • +{{ if $emailnet }}
  • $emailnet
  • {{ endif }}

    diff --git a/view/dfrn_request.tpl b/view/dfrn_request.tpl index d8aa8b1818..bd3bcbc42b 100644 --- a/view/dfrn_request.tpl +++ b/view/dfrn_request.tpl @@ -7,7 +7,7 @@ $page_desc

  • $friendica
  • $diaspora $diasnote
  • $statusnet
  • -
  • $emailnet
  • +{{ if $emailnet }}
  • $emailnet
  • {{ endif }} $invite_desc