aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-04-14 15:12:39 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-04-14 15:12:39 -0400
commit1dd22be4d2fe997d9bde552f8d8a25ba12c67e7e (patch)
tree32486e253628ab64fa466f34dfc0703d9ce8644c
parent16f729912a00cc92d0473f3d326080531a2fb393 (diff)
parent6591b292a1e22e3eaec41af0a61a6911e9847098 (diff)
downloadvolse-hubzilla-1dd22be4d2fe997d9bde552f8d8a25ba12c67e7e.tar.gz
volse-hubzilla-1dd22be4d2fe997d9bde552f8d8a25ba12c67e7e.tar.bz2
volse-hubzilla-1dd22be4d2fe997d9bde552f8d8a25ba12c67e7e.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: bogus empty list element in dfrn_request page when emailnet not enabled zrl on random profile zrl hook bug #372 - category feeds pass zrl's to/through global directory * master:
-rw-r--r--boot.php6
-rw-r--r--include/items.php10
-rw-r--r--index.php8
-rw-r--r--mod/directory.php2
-rw-r--r--mod/randprof.php2
-rw-r--r--view/auto_request.tpl2
-rw-r--r--view/dfrn_request.tpl2
7 files changed, 24 insertions, 8 deletions
diff --git a/boot.php b/boot.php
index 5ba3b1b4a..0bd201a25 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 05c0d5016..85df340d3 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 5dd93523e..442173eeb 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 7f18bd026..367438845 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 = '<ul><li><div id="global-directory-link"><a href="'
- . $gdirpath . '">' . t('Global Directory') . '</a></div></li></ul>';
+ . zrl($gdirpath,true) . '">' . t('Global Directory') . '</a></div></li></ul>';
}
$admin = '';
diff --git a/mod/randprof.php b/mod/randprof.php
index 53d7425e9..6713a81d9 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 2958397c9..961de9bb3 100644
--- a/view/auto_request.tpl
+++ b/view/auto_request.tpl
@@ -7,7 +7,7 @@ $page_desc<br />
<li><a href="http://friendica.com" title="$friendica">$friendica</a></li>
<li><a href="http://joindiaspora.com" title="$diaspora">$diaspora</a> $diasnote</li>
<li><a href="http://ostatus.org" title="$public_net" >$statusnet</a></li>
-<li>$emailnet</li>
+{{ if $emailnet }}<li>$emailnet</li>{{ endif }}
</ul>
</p>
<p>
diff --git a/view/dfrn_request.tpl b/view/dfrn_request.tpl
index d8aa8b181..bd3bcbc42 100644
--- a/view/dfrn_request.tpl
+++ b/view/dfrn_request.tpl
@@ -7,7 +7,7 @@ $page_desc<br />
<li><a href="http://friendica.com" title="$friendica">$friendica</a></li>
<li><a href="http://joindiaspora.com" title="$diaspora">$diaspora</a> $diasnote</li>
<li><a href="http://ostatus.org" title="$public_net" >$statusnet</a></li>
-<li>$emailnet</li>
+{{ if $emailnet }}<li>$emailnet</li>{{ endif }}
</ul>
$invite_desc
</p>