From aee4522ad43acf52ea8e9a65d0d3f5d9c2d5d4ee Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 27 Oct 2015 23:10:52 +0100 Subject: [PATCH 01/22] The contact page now shows the connection status. --- mod/dirfind.php | 16 ++++++++++++---- view/global.css | 5 +++++ view/theme/vier/templates/contact_template.tpl | 3 ++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/mod/dirfind.php b/mod/dirfind.php index 492f39d5a6..c2b18e3e24 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -3,6 +3,7 @@ require_once('include/contact_widgets.php'); require_once('include/socgraph.php'); require_once('include/Contact.php'); require_once('include/contact_selectors.php'); +require_once('mod/contacts.php'); function dirfind_init(&$a) { @@ -77,7 +78,7 @@ function dirfind_content(&$a, $prefix = "") { $j = new stdClass(); $j->total = $count[0]["total"]; $j->items_page = $perpage; - $j->page = $a->pager['page']; + $j->page = $a->pager['page']; foreach ($results AS $result) { if (poco_alternate_ostatus_url($result["url"])) continue; @@ -121,15 +122,21 @@ function dirfind_content(&$a, $prefix = "") { foreach($j->results as $jj) { + $alt_text = ""; + + $itemurl = $jj->url; + // If We already know this contact then don't show the "connect" button if ($jj->cid > 0) { $connlnk = ""; $conntxt = ""; $contact = q("SELECT * FROM `contact` WHERE `id` = %d", intval($jj->cid)); - if ($contact) + if ($contact) { $photo_menu = contact_photo_menu($contact[0]); - else + $details = _contact_detail_for_template($contact[0]); + $alt_text = $details['alt_text']; + } else $photo_menu = array(); } else { $connlnk = $a->get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); @@ -141,8 +148,9 @@ function dirfind_content(&$a, $prefix = "") { $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo); $entry = array( + 'alt_text' => $alt_text, 'url' => zrl($jj->url), - 'itemurl' => $jj->url, + 'itemurl' => $itemurl, 'name' => htmlentities($jj->name), 'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), 'img_hover' => $jj->tags, diff --git a/view/global.css b/view/global.css index e1ccd8b920..6b1c0bfc3a 100644 --- a/view/global.css +++ b/view/global.css @@ -274,3 +274,8 @@ a { #poke-recip-label, #poke-action-label, #prvmail-message-label { margin: 10px 0 10px; } + +.contact-entry-photo img { + max-width: 96px; + max-height: 96px; +} diff --git a/view/theme/vier/templates/contact_template.tpl b/view/theme/vier/templates/contact_template.tpl index add2eff5c1..2993bb92cb 100644 --- a/view/theme/vier/templates/contact_template.tpl +++ b/view/theme/vier/templates/contact_template.tpl @@ -5,7 +5,8 @@ - {{$contact.name}} + + {{$contact.name}} {{if $multiselect}} From 5a58f55a3625af994fc0a91c9a609ff014f4fc15 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 28 Oct 2015 00:18:56 +0100 Subject: [PATCH 02/22] Set the maximum avatar size to 80 pixels --- view/global.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/global.css b/view/global.css index 6b1c0bfc3a..d5a44f75fa 100644 --- a/view/global.css +++ b/view/global.css @@ -276,6 +276,6 @@ a { } .contact-entry-photo img { - max-width: 96px; - max-height: 96px; + max-width: 80px; + max-height: 80px; } From 8eda86d8bf940ec86a0e8b2b3dbf133f4d5e0907 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 28 Oct 2015 19:01:45 +0100 Subject: [PATCH 03/22] lower number of postings displayed per page for not logged in users --- mod/profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/profile.php b/mod/profile.php index b7b76cbb5b..26bd395230 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -268,10 +268,10 @@ function profile_content(&$a, $update = 0) { // accordingly if ($a->is_mobile) { $itemspage_network = get_pconfig(local_user(),'system','itemspage_mobile_network'); - $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20); + $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 10); } else { $itemspage_network = get_pconfig(local_user(),'system','itemspage_network'); - $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40); + $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20); } // now that we have the user settings, see if the theme forces // a maximum item number which is lower then the user choice From e88d9153a1526e28c40793af3717a97a332508ea Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Wed, 28 Oct 2015 23:22:42 +0100 Subject: [PATCH 04/22] fbrowser: exclude Contact Photos --- mod/fbrowser.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mod/fbrowser.php b/mod/fbrowser.php index e7f4b76d48..c4c62afa7b 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -35,8 +35,10 @@ function fbrowser_content($a){ $sql_extra2 = " ORDER BY created DESC LIMIT 0, 10"; if ($a->argc==2){ - $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d ", - intval(local_user()) + $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' ", + intval(local_user()), + dbesc('Contact Photos'), + dbesc( t('Contact Photos')) ); // anon functions only from 5.3.0... meglio tardi che mai.. $folder1 = function($el) use ($mode) {return array(bin2hex($el['album']),$el['album']);}; @@ -53,9 +55,11 @@ function fbrowser_content($a){ } $r = q("SELECT `resource-id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc` - FROM `photo` WHERE `uid` = %d $sql_extra + FROM `photo` WHERE `uid` = %d $sql_extra AND `album` != '%s' AND `album` != '%s' GROUP BY `resource-id` $sql_extra2", - intval(local_user()) + intval(local_user()), + dbesc('Contact Photos'), + dbesc( t('Contact Photos')) ); function files1($rr){ @@ -94,7 +98,7 @@ function fbrowser_content($a){ break; case "file": if ($a->argc==2){ - $files = q("SELECT id, filename, filetype FROM `attach` WHERE `uid` = %d ", + $files = q("SELECT `id`, `filename`, `filetype` FROM `attach` WHERE `uid` = %d ", intval(local_user()) ); From 2e316b5cf2c39660b34430a82bc1308cb7717c1f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 29 Oct 2015 08:10:39 +0100 Subject: [PATCH 05/22] Show the profile in the network view when viewing single contacts --- mod/network.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod/network.php b/mod/network.php index 639d868fa2..66beface08 100644 --- a/mod/network.php +++ b/mod/network.php @@ -150,6 +150,14 @@ function network_init(&$a) { $a->page['aside'] .= saved_searches($search); $a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : '')); + if(x($_GET['cid']) && intval($_GET['cid']) != 0) { + $r = q("SELECT * FROM `contact` WHERE `id` = %d", + intval($_GET['cid'])); + if ($r) { + $a->page['aside'] = ""; + profile_load($a, "", 0, $r[0]); + } + } } function saved_searches($search) { From dff1a73bd3c54d621565d6094915fba89f5e8fcc Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 29 Oct 2015 07:11:36 +0100 Subject: [PATCH 06/22] basic styling of the credits list --- view/global.css | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/view/global.css b/view/global.css index d5a44f75fa..1a71b21951 100644 --- a/view/global.css +++ b/view/global.css @@ -260,19 +260,26 @@ a { } /* poke */ #poke-desc { - margin: 5px 0 10px; + margin: 5px 0 10px; } #poke-wrapper { - padding: 10px 0 0px; + padding: 10px 0 0px; } #poke-recipient, #poke-action, #poke-privacy-settings { - margin: 10px 0 30px; + margin: 10px 0 30px; } #poke-recip-label, #poke-action-label, #prvmail-message-label { - margin: 10px 0 10px; + margin: 10px 0 10px; +} +ul.credits { + list-style: none; +} +ul.credits li { + float: left; + width: 240px; } .contact-entry-photo img { From bc8c6eb455e33a9635c20672e87e6fe0b515c0ff Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 29 Oct 2015 07:12:50 +0100 Subject: [PATCH 07/22] python script to generate the credits.txt from git log and translator names --- util/make_credits.py | 103 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100755 util/make_credits.py diff --git a/util/make_credits.py b/util/make_credits.py new file mode 100755 index 0000000000..f46ec004eb --- /dev/null +++ b/util/make_credits.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +This script will collect the contributors to friendica and its translations from + * the git log of the friendica core and addons repositories + * the translated messages.po from core and the addons. +The collected names will be saved in /util/credits.txt which is also parsed from +yourfriendica.tld/credits. + +The output is not perfect, so remember to open a fresh (re)created credits.txt file +in your fav editor to check for obvious mistakes. + +Initially written by Tobias Diekershoff for the Friendica Project. Released under +the terms of the AGPL version 3 or later, same as Friendica. +""" + +from sys import argv +import os, glob, subprocess + +# a list of names to not include, those people get into the list by other names +# but they use different names on different systems and automatical mapping does +# not work in some cases. +dontinclude = ['root', 'friendica', 'bavatar', 'tony baldwin', 'Taek', 'silke m', + 'leberwurscht', 'abinoam', 'fabrixxm', 'FULL NAME', 'Hauke Zuehl', + 'Michal Supler', 'michal_s', 'Manuel Pérez'] + +# this script is in the /util sub-directory of the friendica installation +# so the friendica path is the 0th argument of calling this script but we +# need to remove the name of the file and the name of the directory +path = os.path.abspath(argv[0].split('util/make_credits.py')[0]) +print('> base directory is assumed to be: '+path) +# a place to store contributors +contributors = [] +# get the contributors +print('> getting contributors to the friendica core repository') +p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) +c = iter(p.stdout.readline, b'') +for i in c: + name = i.decode().split('\t')[1].split('\n')[0] + if not name in contributors and name not in dontinclude: + contributors.append(name) +n1 = len(contributors) +print(' > found %d contributors' % n1) +# get the contributors to the addons +os.chdir(path+'/addon') +# get the contributors +print('> getting contributors to the addons') +p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) +c = iter(p.stdout.readline, b'') +for i in c: + name = i.decode().split('\t')[1].split('\n')[0] + if not name in contributors and name not in dontinclude: + contributors.append(name) +n2 = len(contributors) +print(' > found %d new contributors' % (n2-n1)) +print('> total of %d contributors to the repositories of friendica' % n2) +os.chdir(path) +# get the translators +print('> getting translators') +intrans = False +for f in glob.glob(path+'/view/*/messages.po'): + i = open(f, 'r') + l = i.readlines() + i.close() + for ll in l: + if intrans and ll.strip()=='': + intrans = False; + if intrans and ll[0]=='#': + name = ll.split('# ')[1].split(',')[0].split(' <')[0] + if not name in contributors and name not in dontinclude: + contributors.append(name) + if "# Translators:" in ll: + intrans = True +# get the translators from the addons +for f in glob.glob(path+'/addon/*/lang/*/messages.po'): + i = open(f, 'r') + l = i.readlines() + i.close() + for ll in l: + if intrans and ll.strip()=='': + intrans = False; + if intrans and ll[0]=='#': + name = ll.split('# ')[1].split(',')[0].split(' <')[0] + if not name in contributors and name not in dontinclude: + contributors.append(name) + if "# Translators:" in ll: + intrans = True +# done with the translators + +n3 = len(contributors) +print(' > found %d translators' % (n3-n2)) +print('> found a total of %d contributors and translators' % n3) +contributors.sort(key=str.lower) + +f = open(path+'/util/credits.txt', 'w') +f.write("\n".join(contributors)) +f.close() +print('> list saved to util/credits.txt') From a48156aab66a85b03af640d84e3d884822b9a671 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 29 Oct 2015 07:13:29 +0100 Subject: [PATCH 08/22] display names listed in credits.txt from /credits --- mod/credits.php | 20 +++++ util/credits.txt | 164 +++++++++++++++++++++++++++++++++++++ view/templates/credits.tpl | 8 ++ 3 files changed, 192 insertions(+) create mode 100644 mod/credits.php create mode 100644 util/credits.txt create mode 100644 view/templates/credits.tpl diff --git a/mod/credits.php b/mod/credits.php new file mode 100644 index 0000000000..4907363531 --- /dev/null +++ b/mod/credits.php @@ -0,0 +1,20 @@ + t('Credits'), + '$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'), + '$names' => $arr, + )); +} diff --git a/util/credits.txt b/util/credits.txt new file mode 100644 index 0000000000..60ac4c6dd5 --- /dev/null +++ b/util/credits.txt @@ -0,0 +1,164 @@ +23n +Abinoam P. Marques Jr. +Abrax +Adam Jurkiewicz +Alex +Alexander Kampmann +AlfredSK +André Lohan +Anthronaut +Arian - Cazare Muncitori +aweiher +axelt +balderino +Beanow +bufalo1973 +Calango Jr +Carlos Solís +Carsten Pfeiffer +Cat Gray +Chris Case +Christian M. Grube +Christian Vogeley +Cohan Robinson +Cyboulette +Cyryl Sochacki +czarnystokrotek +Damien Goutte-Gattat +Daniel Dupriest +Daria Początek +David +David Martín Miranda +Devlon Duthie +Diego Souza +Domovoy +Doru DEACONU +Dylan Thiedeke +Développeur égaré +eddy2508 +effex7 +Elena +emilia.krawczyk +Eric Côté +erik +Erkan Yilmaz +Fabian Dost +Fabio Comuni +felixgilles +Filip Bugaj +FlxAlbroscheit +foss +Francesco Apruzzese +Frank Dieckmann +Frederico Gonçalves Guimarães +gerhard6380 +Gert Cauwenberg +greeneyedred +Gregory Smith +Haakon Meland Eriksen +Hans Meine +hauke +Hauke Altmann +Hauke Zühl +Hubert Kościański +Jak +Jakob +jensp +jeroenpraat +Johannes Schwab +John Brazil +Josef Moravek +juanman +julia.domagalska +Karel Vandecandelaere +Karolina +Keith Fernie +Klaus Weidenbach +Lea1995polish +Leberwurscht +Leonard Lausen +Lionel Triay +Ludovic Grossard +maase2 +Magdalena Gazda +Mai Anh Nguyen +Manuel Pérez Monís +Marcin Klessa +Mariusz Pisz +marmor +Marquis_de_Carabas +Martin Schmitt +Mateusz Mikos +Mats Sjöberg +Matthew Exon +Matthias +Matthias Moritz +Max Weller +mhnxo +Michael Johnston +Michael Vogel +Michal Šupler +Michalina +Mike Macgirvin +Nicola Spanti +Olaf Conradi +Oliver +Olivier +Olivier Migeot +Pavel Morozov +peturisfeld +Piotr Blonkowski +pokerazor +Rabuzarus +Radek +Rafael +Rainulf Pineda +rcmaniac +rebeka-catalina +repat +Ricardo Pereira +Rui Andrada +Sam +Sandro Santilli +Sebastian Egbers +sella +Sennewood +Seth +Silke Meyer +Simon L'nu +Simó Albert i Beltran +Stanislav N. +StefOfficiel +Sveinn í Felli +Sven Anders +Sylvain Lagacé +szymon.filip +Sérgio Lima +Taekus +Tazman DeVille +Thomas +Thomas Willingham +thorsten23 +Tino +Tobias Diekershoff +Tobias Hößl +tomamplius +tomtom84 +Tony Baldwin +TORminator +tschlotfeldt +Tubuntu +tupambae +tuscanhobbit +U-SOUND\mike +ufic +Vasudev Kamath +Vasya Novikov +vislav +Yasen Pramatarov +ylms +Zach Prezkuta +Zered +zottel +Zvi ben Yaakov (a.k.a rdc) +Михаил \ No newline at end of file diff --git a/view/templates/credits.tpl b/view/templates/credits.tpl new file mode 100644 index 0000000000..c049a9be09 --- /dev/null +++ b/view/templates/credits.tpl @@ -0,0 +1,8 @@ +

{{$pagetitle}}

+

{{$thanks}}

+ +
    +{{foreach $names as $name}} +
  • {{$name}}
  • +{{/foreach}} +
From 6799c90012b19bee054f00f462a4dad17f1652c4 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 29 Oct 2015 07:58:05 +0100 Subject: [PATCH 09/22] link the credits page from the help pages --- doc/Home.md | 1 + doc/de/Home.md | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/Home.md b/doc/Home.md index 1a219c6efc..d1194a2b6e 100644 --- a/doc/Home.md +++ b/doc/Home.md @@ -54,4 +54,5 @@ Friendica Documentation and Resources **About** * [Site/Version Info](friendica) +* [Friendica Credits](credits) diff --git a/doc/de/Home.md b/doc/de/Home.md index a101b5f734..17e4b7dc29 100644 --- a/doc/de/Home.md +++ b/doc/de/Home.md @@ -59,4 +59,5 @@ Friendica - Dokumentation und Ressourcen **Über diese Seite** * [Seite/Friendica-Version](friendica) +* [Mitwirkenden bei Friendica](credits) From f0f3360c4bcaf5d91ed6432f8ff58ccbbd3b2e6e Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 29 Oct 2015 15:34:55 +0100 Subject: [PATCH 10/22] vier: include private forums in forum widget --- view/theme/vier/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index 49d92b93b5..51e1e36f62 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -195,7 +195,7 @@ function vier_community_info() { $pagelist = array(); $contacts = q("SELECT `id`, `url`, `name`, `micro` FROM `contact` - WHERE `network`= '%s' AND `forum` AND `uid` = %d AND + WHERE `network`= '%s' AND `uid` = %d AND (`forum` OR `prv`) AND NOT `hidden` AND NOT `blocked` AND NOT `archive` AND NOT `pending` AND `success_update` > `failure_update` From 3be34f82eeedab9df1884d42e33d9982aef73272 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 29 Oct 2015 22:05:48 +0100 Subject: [PATCH 11/22] get special contributors into the credits --- util/credits.txt | 1 + util/make_credits.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/util/credits.txt b/util/credits.txt index 60ac4c6dd5..d31c741d53 100644 --- a/util/credits.txt +++ b/util/credits.txt @@ -5,6 +5,7 @@ Adam Jurkiewicz Alex Alexander Kampmann AlfredSK +Andi Stadler André Lohan Anthronaut Arian - Cazare Muncitori diff --git a/util/make_credits.py b/util/make_credits.py index f46ec004eb..fb4a909b77 100755 --- a/util/make_credits.py +++ b/util/make_credits.py @@ -25,13 +25,14 @@ dontinclude = ['root', 'friendica', 'bavatar', 'tony baldwin', 'Taek', 'silke m' 'leberwurscht', 'abinoam', 'fabrixxm', 'FULL NAME', 'Hauke Zuehl', 'Michal Supler', 'michal_s', 'Manuel Pérez'] + # this script is in the /util sub-directory of the friendica installation # so the friendica path is the 0th argument of calling this script but we # need to remove the name of the file and the name of the directory path = os.path.abspath(argv[0].split('util/make_credits.py')[0]) print('> base directory is assumed to be: '+path) # a place to store contributors -contributors = [] +contributors = ['Andi Stadler'] # get the contributors print('> getting contributors to the friendica core repository') p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'], From 44c3c9f569d14d2691be270ab54583cd99d10d8d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 29 Oct 2015 22:10:24 +0100 Subject: [PATCH 12/22] intro note --- util/make_credits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/make_credits.py b/util/make_credits.py index fb4a909b77..404b059133 100755 --- a/util/make_credits.py +++ b/util/make_credits.py @@ -9,7 +9,7 @@ The collected names will be saved in /util/credits.txt which is also parsed from yourfriendica.tld/credits. The output is not perfect, so remember to open a fresh (re)created credits.txt file -in your fav editor to check for obvious mistakes. +in your fav editor to check for obvious mistakes and doubled entries. Initially written by Tobias Diekershoff for the Friendica Project. Released under the terms of the AGPL version 3 or later, same as Friendica. From f3ce812a9ef2b7aa94be7815b61790deeb460913 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 30 Oct 2015 01:30:42 +0100 Subject: [PATCH 13/22] New function for fetching contact data --- include/Contact.php | 86 +++++++++++++++++++++++++++++++++++++++++++++ mod/network.php | 4 +-- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/include/Contact.php b/include/Contact.php index e6ec8daade..c747f04ea1 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -191,6 +191,92 @@ function unmark_for_death($contact) { ); }} +function contact_data($url, $uid = -1) { + require_once("mod/proxy.php"); + require_once("include/bbcode.php"); + + if ($uid == -1) + $uid = local_user(); + + $r = q("SELECT `url`, `name`, `nick`, `photo`, `location`, `about`, `keywords`, `gender`, `community`, `network` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1", + dbesc(normalise_link($url))); + + if ($r) + $profile = $r[0]; + else { + $r = q("SELECT `url`, `name`, `nick`, `avatar` AS `photo`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'", + dbesc(normalise_link($url))); + + if (count($r)) { + $profile = $r[0]; + $profile["keywords"] = ""; + $profile["gender"] = ""; + $profile["community"] = false; + $profile["network"] = ""; + } + } + + // Fetching further contact data from the contact table + $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `network` = '%s'", + dbesc(normalise_link($url)), intval($uid), dbesc($profile["network"])); + + if (!count($r)) + $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d", + dbesc(normalise_link($url)), intval($uid)); + + if (!count($r)) + $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0", + dbesc(normalise_link($url))); + + if ($r) { + if (isset($r[0]["url"]) AND $r[0]["url"]) + $profile["url"] = $r[0]["url"]; + if (isset($r[0]["name"]) AND $r[0]["name"]) + $profile["name"] = $r[0]["name"]; + if (isset($r[0]["nick"]) AND $r[0]["nick"] AND ($profile["nick"] == "")) + $profile["nick"] = $r[0]["nick"]; + if (isset($r[0]["photo"]) AND $r[0]["photo"]) + $profile["photo"] = $r[0]["photo"]; + if (isset($r[0]["location"]) AND $r[0]["location"]) + $profile["location"] = $r[0]["location"]; + if (isset($r[0]["about"]) AND $r[0]["about"]) + $profile["about"] = $r[0]["about"]; + if (isset($r[0]["keywords"]) AND $r[0]["keywords"]) + $profile["keywords"] = $r[0]["keywords"]; + if (isset($r[0]["gender"]) AND $r[0]["gender"]) + $profile["gender"] = $r[0]["gender"]; + if (isset($r[0]["forum"]) AND isset($r[0]["prv"])) + $profile["community"] = ($r[0]["forum"] OR $r[0]["prv"]); + if (isset($r[0]["network"]) AND $r[0]["network"]) + $profile["network"] = $r[0]["network"]; + if (isset($r[0]["addr"]) AND $r[0]["addr"]) + $profile["addr"] = $r[0]["addr"]; + if (isset($r[0]["bd"]) AND $r[0]["bd"]) + $profile["bd"] = $r[0]["bd"]; + if ($r[0]["uid"] == 0) + $profile["cid"] = 0; + else + $profile["cid"] = $r[0]["id"]; + } else + $profile["cid"] = 0; + + if (isset($profile["photo"])) + $profile["photo"] = proxy_url($profile["photo"], false, PROXY_SIZE_SMALL); + + if (isset($profile["location"])) + $profile["location"] = bbcode($profile["location"]); + + if (isset($profile["about"])) + $profile["about"] = bbcode($profile["about"]); + + if (($profile["cid"] == 0) AND ($profile["network"] == NETWORK_DIASPORA)) { + $profile["location"] = ""; + $profile["about"] = ""; + } + + return($profile); +} + if(! function_exists('contact_photo_menu')){ function contact_photo_menu($contact) { diff --git a/mod/network.php b/mod/network.php index 66beface08..0cfdf5b611 100644 --- a/mod/network.php +++ b/mod/network.php @@ -151,11 +151,11 @@ function network_init(&$a) { $a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : '')); if(x($_GET['cid']) && intval($_GET['cid']) != 0) { - $r = q("SELECT * FROM `contact` WHERE `id` = %d", + $r = q("SELECT `url` FROM `contact` WHERE `id` = %d", intval($_GET['cid'])); if ($r) { $a->page['aside'] = ""; - profile_load($a, "", 0, $r[0]); + profile_load($a, "", 0, contact_data($r[0]["url"])); } } } From 56c9f23e995fb5f72fb632541d1aab43d350fd9b Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Fri, 30 Oct 2015 01:59:17 +0100 Subject: [PATCH 14/22] prvgroup mentioning in status_editor --- mod/network.php | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/mod/network.php b/mod/network.php index 66beface08..539d5347db 100644 --- a/mod/network.php +++ b/mod/network.php @@ -489,7 +489,7 @@ function network_content(&$a, $update = 0) { $content = ""; if ($cid) { - $contact = q("SELECT `nick` FROM `contact` WHERE `id` = %d AND `uid` = %d AND `forum`", + $contact = q("SELECT `nick` FROM `contact` WHERE `id` = %d AND `uid` = %d AND (`forum` OR `prv`) ", intval($cid), intval(local_user()) ); @@ -569,9 +569,9 @@ function network_content(&$a, $update = 0) { //$sql_post_table = " INNER JOIN (SELECT DISTINCT(`parent`) FROM `item` WHERE (`contact-id` IN ($contact_str) OR `allow_gid` like '".protect_sprintf('%<'.intval($group).'>%')."') and deleted = 0 ORDER BY `created` DESC) AS `temp1` ON $sql_table.$sql_parent = `temp1`.`parent` "; $sql_extra3 .= " AND `contact-id` IN ($contact_str$contact_str_self) "; - $sql_extra3 .= " AND EXISTS (SELECT id FROM `item` WHERE (`contact-id` IN ($contact_str) - OR `allow_gid` like '".protect_sprintf('%<'.intval($group).'>%')."') and deleted = 0 - AND parent = $sql_table.$sql_parent) "; + $sql_extra3 .= " AND EXISTS (SELECT `id` FROM `item` WHERE (`contact-id` IN ($contact_str) + OR `allow_gid` LIKE '".protect_sprintf('%<'.intval($group).'>%')."') AND `deleted` = 0 + AND `parent` = $sql_table.$sql_parent) "; $o = replace_macros(get_markup_template("section_title.tpl"),array( '$title' => sprintf( t('Group: %s'), $r[0]['name']) @@ -671,29 +671,30 @@ function network_content(&$a, $update = 0) { } else { if(get_config('system', 'old_pager')) { - $r = q("SELECT COUNT(*) AS `total` - FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id` - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - WHERE $sql_table.`uid` = %d AND $sql_table.`visible` = 1 AND $sql_table.`deleted` = 0 - $sql_extra2 $sql_extra3 - $sql_extra $sql_nets ", - intval($_SESSION['uid']) - ); + $r = q("SELECT COUNT(*) AS `total` + FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id` + AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + WHERE $sql_table.`uid` = %d AND $sql_table.`visible` = 1 AND $sql_table.`deleted` = 0 + $sql_extra2 $sql_extra3 + $sql_extra $sql_nets ", + intval($_SESSION['uid']) + ); - if(count($r)) { - $a->set_pager_total($r[0]['total']); - } + if(count($r)) { + $a->set_pager_total($r[0]['total']); + } } // check if we serve a mobile device and get the user settings // accordingly if ($a->is_mobile) { - $itemspage_network = get_pconfig(local_user(),'system','itemspage_mobile_network'); - $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20); + $itemspage_network = get_pconfig(local_user(),'system','itemspage_mobile_network'); + $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20); } else { - $itemspage_network = get_pconfig(local_user(),'system','itemspage_network'); - $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40); + $itemspage_network = get_pconfig(local_user(),'system','itemspage_network'); + $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40); } + // now that we have the user settings, see if the theme forces // a maximum item number which is lower then the user choice if(($a->force_max_items > 0) && ($a->force_max_items < $itemspage_network)) @@ -704,7 +705,7 @@ function network_content(&$a, $update = 0) { } if($nouveau) { - $simple_update = (($update) ? " and `item`.`unseen` = 1 " : ''); + $simple_update = (($update) ? " AND `item`.`unseen` = 1 " : ''); if ($sql_order == "") $sql_order = "`item`.`received`"; @@ -717,7 +718,7 @@ function network_content(&$a, $update = 0) { FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 - AND `item`.`deleted` = 0 and `item`.`moderated` = 0 + AND `item`.`deleted` = 0 AND `item`.`moderated` = 0 $simple_update $sql_extra $sql_nets ORDER BY $sql_order DESC $pager_sql ", From fc37f49f2308f36c2606b57ce8d1bb95d5fd93c8 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Fri, 30 Oct 2015 12:47:48 +0100 Subject: [PATCH 15/22] network.php: add a descriptive comment --- mod/network.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/network.php b/mod/network.php index 539d5347db..5e9be8d80d 100644 --- a/mod/network.php +++ b/mod/network.php @@ -489,6 +489,7 @@ function network_content(&$a, $update = 0) { $content = ""; if ($cid) { + // If $cid belongs to a communitity forum or a privat goup,.add a mention to the status editor $contact = q("SELECT `nick` FROM `contact` WHERE `id` = %d AND `uid` = %d AND (`forum` OR `prv`) ", intval($cid), intval(local_user()) From c00847a79d8348ad5a7d43175a736012fe5edd00 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 30 Oct 2015 18:05:45 +0100 Subject: [PATCH 16/22] use section_title.tpl for page title --- mod/credits.php | 2 +- view/templates/credits.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/credits.php b/mod/credits.php index 4907363531..f8cfb03f37 100644 --- a/mod/credits.php +++ b/mod/credits.php @@ -13,7 +13,7 @@ function credits_content (&$a) { fclose($f); $tpl = get_markup_template('credits.tpl'); return replace_macros( $tpl, array( - '$pagetitle' => t('Credits'), + '$title' => t('Credits'), '$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'), '$names' => $arr, )); diff --git a/view/templates/credits.tpl b/view/templates/credits.tpl index c049a9be09..2441358024 100644 --- a/view/templates/credits.tpl +++ b/view/templates/credits.tpl @@ -1,4 +1,4 @@ -

{{$pagetitle}}

+{{include file="section_title.tpl"}}

{{$thanks}}

    From 09ff2f0dd57a6fda0dd94485c602596c23187bdb Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 31 Oct 2015 00:01:33 +0100 Subject: [PATCH 17/22] Renamed the function --- include/Contact.php | 2 +- mod/network.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Contact.php b/include/Contact.php index c747f04ea1..3f74a19d5f 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -191,7 +191,7 @@ function unmark_for_death($contact) { ); }} -function contact_data($url, $uid = -1) { +function get_contact_details_by_url($url, $uid = -1) { require_once("mod/proxy.php"); require_once("include/bbcode.php"); diff --git a/mod/network.php b/mod/network.php index 0cfdf5b611..e58c0cee49 100644 --- a/mod/network.php +++ b/mod/network.php @@ -155,7 +155,7 @@ function network_init(&$a) { intval($_GET['cid'])); if ($r) { $a->page['aside'] = ""; - profile_load($a, "", 0, contact_data($r[0]["url"])); + profile_load($a, "", 0, get_contact_details_by_url($r[0]["url"])); } } } From 7cf446835372eed5f73130e2f09a20308e4080c0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 31 Oct 2015 10:32:01 +0100 Subject: [PATCH 18/22] Bugfix: /poco was always empty --- mod/poco.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/mod/poco.php b/mod/poco.php index 4d16c6ed29..ae03aef2cd 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -69,14 +69,8 @@ function poco_init(&$a) { dbesc(NETWORK_OSTATUS) ); } elseif($system_mode) { - $r = q("SELECT count(*) AS `total` FROM `contact` WHERE `self` = 1 AND `network` IN ('%s', '%s', '%s', '%s') - AND (`success_update` >= `failure_update` OR `last-item` >= `failure_update`) - AND `uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) ", - dbesc(NETWORK_DFRN), - dbesc(NETWORK_DIASPORA), - dbesc(NETWORK_OSTATUS), - dbesc(NETWORK_STATUSNET) - ); + $r = q("SELECT count(*) AS `total` FROM `contact` WHERE `self` = 1 + AND `uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) "); } else { $r = q("SELECT count(*) AS `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0 AND (`success_update` >= `failure_update` OR `last-item` >= `failure_update`) @@ -115,13 +109,8 @@ function poco_init(&$a) { $r = q("SELECT `contact`.*, `profile`.`about` AS `pabout`, `profile`.`locality` AS `plocation`, `profile`.`pub_keywords`, `profile`.`gender` AS `pgender`, `profile`.`address` AS `paddress`, `profile`.`region` AS `pregion`, `profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry` FROM `contact` INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid` - WHERE `self` = 1 AND `network` IN ('%s', '%s', '%s', '%s') AND `profile`.`is-default` - AND ((`contact`.`success_update` >= `contact`.`failure_update`) OR (`contact`.`last-item` >= `contact`.`failure_update`)) + WHERE `self` = 1 AND `profile`.`is-default` AND `contact`.`uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) LIMIT %d, %d", - dbesc(NETWORK_DFRN), - dbesc(NETWORK_DIASPORA), - dbesc(NETWORK_OSTATUS), - dbesc(NETWORK_STATUSNET), intval($startIndex), intval($itemsPerPage) ); From b87d7ef1af42c897bc0db3316e26af4f43a2b783 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 1 Nov 2015 08:54:44 +0100 Subject: [PATCH 19/22] Return the contact id at "all_friends" and "common_contacts" --- include/socgraph.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/include/socgraph.php b/include/socgraph.php index 225acda4a2..17f2fcf01e 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -1047,7 +1047,7 @@ function count_common_friends($uid,$cid) { intval($cid) ); -// logger("count_common_friends: $uid $cid {$r[0]['total']}"); +// logger("count_common_friends: $uid $cid {$r[0]['total']}"); if(count($r)) return $r[0]['total']; return 0; @@ -1062,11 +1062,14 @@ function common_friends($uid,$cid,$start = 0,$limit=9999,$shuffle = false) { else $sql_extra = " order by `gcontact`.`name` asc "; - $r = q("SELECT `gcontact`.* - FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id` - where `glink`.`cid` = %d and `glink`.`uid` = %d - and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 and id != %d ) - $sql_extra limit %d, %d", + $r = q("SELECT `gcontact`.*, `contact`.`id` AS `cid` + FROM `glink` + INNER JOIN `gcontact` ON `glink`.`gcid` = `gcontact`.`id` + INNER JOIN `contact` ON `gcontact`.`nurl` = `contact`.`nurl` + WHERE `glink`.`cid` = %d and `glink`.`uid` = %d + AND `contact`.`uid` = %d AND `contact`.`self` = 0 AND `contact`.`blocked` = 0 + AND `contact`.`hidden` = 0 AND `contact`.`id` != %d + $sql_extra LIMIT %d, %d", intval($cid), intval($uid), intval($uid), @@ -1137,10 +1140,13 @@ function count_all_friends($uid,$cid) { function all_friends($uid,$cid,$start = 0, $limit = 80) { - $r = q("SELECT `gcontact`.* - FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id` - where `glink`.`cid` = %d and `glink`.`uid` = %d - order by `gcontact`.`name` asc LIMIT %d, %d ", + $r = q("SELECT `gcontact`.*, `contact`.`id` AS `cid` + FROM `glink` + INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id` + LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`uid` = %d + WHERE `glink`.`cid` = %d AND `glink`.`uid` = %d + ORDER BY `gcontact`.`name` ASC LIMIT %d, %d ", + intval($uid), intval($cid), intval($uid), intval($start), From 6a53e3959f852e15b54e524813357ee989f9151c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 1 Nov 2015 09:45:02 +0100 Subject: [PATCH 20/22] Vier: The different styles are now working with the right menubar --- view/theme/vier/dark.css | 2 +- view/theme/vier/flat.css | 4 ++++ view/theme/vier/netcolour.css | 1 - view/theme/vier/plus.css | 4 ++++ view/theme/vier/style.css | 18 ++++++++++++++++-- view/theme/vier/wide.css | 18 ------------------ 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/view/theme/vier/dark.css b/view/theme/vier/dark.css index 9501ecfe0d..01045b6ff4 100644 --- a/view/theme/vier/dark.css +++ b/view/theme/vier/dark.css @@ -23,7 +23,7 @@ a.on { background-color: #2C77AE !important } -aside, .menu-popup, .fc-state-highlight, a.off, .autocomplete { +aside, right_aside, .menu-popup, .fc-state-highlight, a.off, .autocomplete { color: #989898 !important; background-color: #252C33 !important; border-right: 1px solid #D2D2D2; diff --git a/view/theme/vier/flat.css b/view/theme/vier/flat.css index d71ab2177b..a00d19c39c 100644 --- a/view/theme/vier/flat.css +++ b/view/theme/vier/flat.css @@ -12,3 +12,7 @@ div.pager, ul.tabs { aside { border-right: 1px solid #D2D2D2; } + +right_aside { + border-left: 1px solid #D2D2D2; +} diff --git a/view/theme/vier/netcolour.css b/view/theme/vier/netcolour.css index c76e5b0af4..77fea09f5a 100644 --- a/view/theme/vier/netcolour.css +++ b/view/theme/vier/netcolour.css @@ -31,4 +31,3 @@ /* background-color: #FFFFF9; */ background-color: #fffafa; } - diff --git a/view/theme/vier/plus.css b/view/theme/vier/plus.css index 2ae6e50005..5faf069c22 100644 --- a/view/theme/vier/plus.css +++ b/view/theme/vier/plus.css @@ -145,6 +145,10 @@ aside { height: calc(100% - 54px); } +right_aside { + top: 44px; +} + section { top: 44px; } diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index a041eb3f1a..15e42e79a6 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -872,9 +872,23 @@ ul.menu-popup .empty { } right_aside { - width: 0px; - top: 32px; display: none; + vertical-align: top; + width: 185px; + padding-top: 10px; + padding-right: 20px; + padding-bottom: 0px; + padding-left: 10px; + background-color: #FFFFFF; + font-size: 13px; + overflow-y: auto; + z-index: 2; + line-height: 17px; + color: #737373; + box-shadow: 1px 2px 0px 0px #D8D8D8; + top: 32px; + position: absolute; + margin-left: calc(100% - 215px); } /* aside */ diff --git a/view/theme/vier/wide.css b/view/theme/vier/wide.css index 6f8d5427cc..72c2673261 100644 --- a/view/theme/vier/wide.css +++ b/view/theme/vier/wide.css @@ -1,23 +1,5 @@ right_aside { - vertical-align: top; - width: 185px; - padding-top: 10px; - padding-right: 20px; - padding-bottom: 0px; - padding-left: 10px; - background-color: #FFFFFF; - font-size: 13px; - overflow-y: auto; - z-index: 2; - line-height: 17px; - color: #737373; - top: 44px; - position: absolute; -/* position: fixed; - height: calc(100% - 54px); */ display: block; - margin-left: calc(100% - 215px); - box-shadow: 1px 2px 0px 0px #D8D8D8; } #forumlist-sidebar { From 709aac065240c6874ee9c428eebcc774c52df386 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 1 Nov 2015 13:55:49 +0100 Subject: [PATCH 21/22] Only offer the choice to activate Diaspora and OStatus if the system is ready for it --- mod/admin.php | 11 +++++++++++ mod/dirfind.php | 14 ++++++++++++-- mod/follow.php | 24 +++++++++++++++++++++--- view/templates/admin_site.tpl | 22 +++++++++++++++++++--- view/templates/auto_request.tpl | 4 +++- view/templates/dfrn_request.tpl | 4 +++- view/templates/field_checkbox.tpl | 2 -- 7 files changed, 69 insertions(+), 12 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 878508a23f..6337e4608d 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -416,6 +416,11 @@ function admin_page_site_post(&$a){ $rino = ((x($_POST,'rino')) ? intval($_POST['rino']) : 0); $embedly = ((x($_POST,'embedly')) ? notags(trim($_POST['embedly'])) : ''); + if ($a->get_path() != "") + $diaspora_enabled = false; + + if (!$thread_allow) + $ostatus_disabled = true; if($ssl_policy != intval(get_config('system','ssl_policy'))) { if($ssl_policy == SSL_POLICY_FULL) { @@ -535,6 +540,7 @@ function admin_page_site_post(&$a){ set_config('system','ostatus_disabled', $ostatus_disabled); set_config('system','ostatus_poll_interval', $ostatus_poll_interval); set_config('system','diaspora_enabled', $diaspora_enabled); + set_config('config','private_addons', $private_addons); set_config('system','force_ssl', $force_ssl); @@ -681,6 +687,8 @@ function admin_page_site(&$a) { if ($a->config['hostname'] == "") $a->config['hostname'] = $a->get_hostname(); + $diaspora_able = ($a->get_path() == ""); + $t = get_markup_template("admin_site.tpl"); return replace_macros($t, array( '$title' => t('Administration'), @@ -737,6 +745,9 @@ function admin_page_site(&$a) { '$max_author_posts_community_page' => array('max_author_posts_community_page', t("Posts per user on community page"), get_config('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")), '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")), '$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices), + '$ostatus_not_able' => t("OStatus support can only be enabled if threading is enabled."), + '$diaspora_able' => $diaspora_able, + '$diaspora_not_able' => t("Diaspora support can't be enabled because Friendica was installed into a sub directory."), '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")), diff --git a/mod/dirfind.php b/mod/dirfind.php index c2b18e3e24..4213ec4b60 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -52,10 +52,20 @@ function dirfind_content(&$a, $prefix = "") { $perpage = 80; $startrec = (($a->pager['page']) * $perpage) - $perpage; + if (get_config('system','diaspora_enabled')) + $diaspora = NETWORK_DIASPORA; + else + $diaspora = NETWORK_DFRN; + + if (!get_config('system','ostatus_disabled')) + $ostatus = NETWORK_OSTATUS; + else + $ostatus = NETWORK_DFRN; + $count = q("SELECT count(*) AS `total` FROM `gcontact` WHERE `network` IN ('%s', '%s', '%s') AND (`url` REGEXP '%s' OR `name` REGEXP '%s' OR `location` REGEXP '%s' OR `about` REGEXP '%s' OR `keywords` REGEXP '%s')".$extra_sql, - dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA), + dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora), dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search))); @@ -71,7 +81,7 @@ function dirfind_content(&$a, $prefix = "") { GROUP BY `gcontact`.`nurl` ORDER BY `gcontact`.`updated` DESC LIMIT %d, %d", intval(local_user()), dbesc(CONTACT_IS_SHARING), dbesc(CONTACT_IS_FRIEND), - dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA), + dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora), dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)), intval($startrec), intval($perpage)); diff --git a/mod/follow.php b/mod/follow.php index 54c20e5093..cc08831285 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -15,6 +15,8 @@ function follow_content(&$a) { $uid = local_user(); $url = notags(trim($_REQUEST['url'])); + $submit = t('Submit Request'); + // There is a current issue. It seems as if you can't start following a Friendica that is following you // With Diaspora this works - but Friendica is special, it seems ... $r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND ((`rel` != %d) OR (`network` = '%s')) AND @@ -25,15 +27,31 @@ function follow_content(&$a) { if ($r) { notice(t('You already added this contact.').EOL); - goaway($_SESSION['return_url']); + $submit = ""; + //goaway($_SESSION['return_url']); // NOTREACHED } $ret = probe_url($url); + if (($ret["network"] == NETWORK_DIASPORA) AND !get_config('system','diaspora_enabled')) { + notice( t("Diaspora support isn't enabled. Contact can't be added.") . EOL); + $submit = ""; + //goaway($_SESSION['return_url']); + // NOTREACHED + } + + if (($ret["network"] == NETWORK_OSTATUS) AND get_config('system','ostatus_disabled')) { + notice( t("OStatus support is disabled. Contact can't be added.") . EOL); + $submit = ""; + //goaway($_SESSION['return_url']); + // NOTREACHED + } + if ($ret["network"] == NETWORK_PHANTOM) { notice( t("The network type couldn't be detected. Contact can't be added.") . EOL); - goaway($_SESSION['return_url']); + $submit = ""; + //goaway($_SESSION['return_url']); // NOTREACHED } @@ -94,7 +112,7 @@ function follow_content(&$a) { '$your_address' => t('Your Identity Address:'), '$invite_desc' => "", '$emailnet' => "", - '$submit' => t('Submit Request'), + '$submit' => $submit, '$cancel' => t('Cancel'), '$nickname' => "", '$name' => $ret["name"], diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index b60c4f0558..13270e2eba 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -83,9 +83,25 @@ {{include file="field_checkbox.tpl" field=$force_publish}} {{include file="field_select.tpl" field=$community_page_style}} {{include file="field_input.tpl" field=$max_author_posts_community_page}} - {{include file="field_checkbox.tpl" field=$ostatus_disabled}} - {{include file="field_select.tpl" field=$ostatus_poll_interval}} - {{include file="field_checkbox.tpl" field=$diaspora_enabled}} + + {{if $thread_allow.2}} + {{include file="field_checkbox.tpl" field=$ostatus_disabled}} + {{include file="field_select.tpl" field=$ostatus_poll_interval}} + {{else}} +
    + + {{$ostatus_not_able}} +
    + {{/if}} + + {{if $diaspora_able}} + {{include file="field_checkbox.tpl" field=$diaspora_enabled}} + {{else}} +
    + + {{$diaspora_not_able}} +
    + {{/if}} {{include file="field_checkbox.tpl" field=$dfrn_only}} {{include file="field_input.tpl" field=$global_directory}} {{include file="field_checkbox.tpl" field=$thread_allow}} diff --git a/view/templates/auto_request.tpl b/view/templates/auto_request.tpl index f938d63719..d6abde0306 100644 --- a/view/templates/auto_request.tpl +++ b/view/templates/auto_request.tpl @@ -53,7 +53,9 @@
    - + {{if $submit}} + + {{/if}}
    diff --git a/view/templates/dfrn_request.tpl b/view/templates/dfrn_request.tpl index 178586a7b7..3b96d3eefd 100644 --- a/view/templates/dfrn_request.tpl +++ b/view/templates/dfrn_request.tpl @@ -83,7 +83,9 @@
    - + {{if $submit}} + + {{/if}}
    diff --git a/view/templates/field_checkbox.tpl b/view/templates/field_checkbox.tpl index f90b012f1c..e476c07d72 100644 --- a/view/templates/field_checkbox.tpl +++ b/view/templates/field_checkbox.tpl @@ -1,5 +1,3 @@ - -
    From 4525db2c4afcdce140b29370ee80ef9655589774 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Mon, 2 Nov 2015 09:35:07 +0100 Subject: [PATCH 22/22] Small fix: one "mistpark" left in doc/Settings.md --- doc/Settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Settings.md b/doc/Settings.md index 60fff847a0..ae7d916078 100644 --- a/doc/Settings.md +++ b/doc/Settings.md @@ -198,7 +198,7 @@ Config: This configures the URL to update the global directory, and is supplied in the default configuration. The undocumented part is that if this is not set, the global directory is completely unavailable to the application. -This allows a private community to be completely isolated from the global mistpark network. +This allows a private community to be completely isolated from the global network. $a->config['system']['directory'] = 'http://dir.friendi.ca';