From 0d869ceb65badbd4d80dd0d5cf2d631bca7f5b9e Mon Sep 17 00:00:00 2001
From: friendica
Date: Sat, 14 Apr 2012 03:51:41 -0700
Subject: [PATCH 1/5] pass zrl's to/through global directory
---
boot.php | 6 ++++--
mod/directory.php | 2 +-
2 files changed, 5 insertions(+), 3 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/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 = '';
+ . zrl($gdirpath,true) . '">' . t('Global Directory') . '';
}
$admin = '';
From 9dd0ef2aeb5fba611042b89ba59236ca23ded965 Mon Sep 17 00:00:00 2001
From: friendica
Date: Sat, 14 Apr 2012 04:19:41 -0700
Subject: [PATCH 2/5] bug #372 - category feeds
---
include/items.php | 10 ++++++++++
1 file changed, 10 insertions(+)
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 ";
From f4ea764aaf125adc1bd94c921d1afd5e308f61bf Mon Sep 17 00:00:00 2001
From: friendica
Date: Sat, 14 Apr 2012 04:54:26 -0700
Subject: [PATCH 3/5] zrl hook
---
index.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
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);
+ }
}
/**
From 6af4183302d99cea9385b48c1867124257984935 Mon Sep 17 00:00:00 2001
From: friendica
Date: Sat, 14 Apr 2012 05:07:00 -0700
Subject: [PATCH 4/5] zrl on random profile
---
mod/randprof.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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');
}
From 6591b292a1e22e3eaec41af0a61a6911e9847098 Mon Sep 17 00:00:00 2001
From: friendica
Date: Sat, 14 Apr 2012 05:32:31 -0700
Subject: [PATCH 5/5] bogus empty list element in dfrn_request page when
emailnet not enabled
---
view/auto_request.tpl | 2 +-
view/dfrn_request.tpl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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
$friendica
$diaspora $diasnote
$statusnet
-$emailnet
+{{ if $emailnet }}$emailnet{{ endif }}
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
$friendica
$diaspora $diasnote
$statusnet
-$emailnet
+{{ if $emailnet }}$emailnet{{ endif }}
$invite_desc