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/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'; 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) diff --git a/include/Contact.php b/include/Contact.php index e6ec8daade..3f74a19d5f 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -191,6 +191,92 @@ function unmark_for_death($contact) { ); }} +function get_contact_details_by_url($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/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), 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/credits.php b/mod/credits.php new file mode 100644 index 0000000000..f8cfb03f37 --- /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/mod/dirfind.php b/mod/dirfind.php index 492f39d5a6..4213ec4b60 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) { @@ -51,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))); @@ -70,14 +81,14 @@ 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)); $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 +132,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 +158,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/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()) ); 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/mod/network.php b/mod/network.php index 639d868fa2..42c416b32f 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 `url` FROM `contact` WHERE `id` = %d", + intval($_GET['cid'])); + if ($r) { + $a->page['aside'] = ""; + profile_load($a, "", 0, get_contact_details_by_url($r[0]["url"])); + } + } } function saved_searches($search) { @@ -481,7 +489,8 @@ function network_content(&$a, $update = 0) { $content = ""; if ($cid) { - $contact = q("SELECT `nick` FROM `contact` WHERE `id` = %d AND `uid` = %d AND `forum`", + // 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()) ); @@ -561,9 +570,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']) @@ -663,29 +672,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)) @@ -696,7 +706,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`"; @@ -709,7 +719,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 ", 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) ); 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 diff --git a/util/credits.txt b/util/credits.txt new file mode 100644 index 0000000000..d31c741d53 --- /dev/null +++ b/util/credits.txt @@ -0,0 +1,165 @@ +23n +Abinoam P. Marques Jr. +Abrax +Adam Jurkiewicz +Alex +Alexander Kampmann +AlfredSK +Andi Stadler +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/util/make_credits.py b/util/make_credits.py new file mode 100755 index 0000000000..404b059133 --- /dev/null +++ b/util/make_credits.py @@ -0,0 +1,104 @@ +#!/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 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 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 = ['Andi Stadler'] +# 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') diff --git a/view/global.css b/view/global.css index e1ccd8b920..1a71b21951 100644 --- a/view/global.css +++ b/view/global.css @@ -260,17 +260,29 @@ 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 { + max-width: 80px; + max-height: 80px; } 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}} +
{{$thanks}}
+ +