Merge branch 'release-3.3.1'

This commit is contained in:
fabrixxm 2014-11-06 20:43:38 +01:00
commit ac29e831b2
28 changed files with 6482 additions and 6210 deletions

29
CHANGELOG Normal file
View File

@ -0,0 +1,29 @@
Version 3.3.1
JSONP support for API (fabrixxm)
Fixed small bug in direct messages API (fabrixxm)
More filter for direct messages API (fabrixxm)
New hooks "getsiteinfo", "page_info_data" (annando)
Better loop post prevention (annando)
Via API, replace data: uri images in plain text version with link to post. (issue #1134) (fabrixxm)
Set default location to empty for new users. Suppress warning on user creation (issue #1193) (fabrixxm)
Correctly build urls with queries (issue #1190) (fabrixxm)
Optionally use keywords in feed as post tags with "remote self" (annando)
A blacklist of keywords to not use can be defined (annando)
"remote self" works also with Friendica and Diaspora contacts (annando)
Show exact post time after 12 hours (FX7)
Optionally redirect from non-SSL to SSL (annando)
Translation updates
Added CHANGELOG
Version 3.3
See http://friendica.com/node/64
Version 3.2
See http://friendica.com/node/61
Version 3.1
See http://friendica.com/node/58

View File

@ -16,9 +16,9 @@ require_once('include/dbstructure.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Ginger');
define ( 'FRIENDICA_VERSION', '3.3' );
define ( 'FRIENDICA_VERSION', '3.3.1' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1173 );
define ( 'DB_UPDATE_VERSION', 1174 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -522,21 +522,28 @@ if(! class_exists('App')) {
if (substr($this->query_string, 0, 1) == "/")
$this->query_string = substr($this->query_string, 1);
}
if (x($_GET,'pagename'))
$this->cmd = trim($_GET['pagename'],'/\\');
elseif (x($_GET,'q'))
$this->cmd = trim($_GET['q'],'/\\');
// fix query_string
$this->query_string = str_replace($this->cmd."&",$this->cmd."?", $this->query_string);
// unix style "homedir"
if(substr($this->cmd,0,1) === '~')
$this->cmd = 'profile/' . substr($this->cmd,1);
$this->cmd = 'profile/' . substr($this->cmd,1);
// Diaspora style profile url
if(substr($this->cmd,0,2) === 'u/')
$this->cmd = 'profile/' . substr($this->cmd,2);
/**
*
* Break the URL path into C style argc/argv style arguments for our
@ -609,6 +616,10 @@ if(! class_exists('App')) {
return($basepath);
}
function get_scheme() {
return($this->scheme);
}
function get_baseurl($ssl = false) {
$scheme = $this->scheme;

View File

@ -34,6 +34,7 @@ Friendica Documentation and Resources
* [Using SSL with Friendica](help/SSL)
* [Developers](help/Developers)
* [Twitter/StatusNet API Functions](help/api)
* [Translation of Friendica](help/translations)
**External Resources**

View File

@ -33,6 +33,8 @@ Friendica - Dokumentation und Ressourcen
* [Nachrichtenfluss](help/Message-Flow)
* [Betreibe deine Seite mit einem SSL-Zertifikat](help/SSL)
* [Entwickler](help/Developers)
* [Twitter/StatusNet API Functions](help/api) (EN)
* [Translation of Friendica](help/translations) (EN)
**Externe Ressourcen**

View File

@ -34,6 +34,7 @@ Friendica Documentation and Resources
* [Using SSL with Friendica](help/SSL)
* [Developers](help/Developers)
* [Twitter/StatusNet API Functions](help/api)
* [Translation of Friendica](help/translations)
**External Resources**

95
doc/translations.md Normal file
View File

@ -0,0 +1,95 @@
Friendica translations
======================
Translation Process
-------------------
The strings used in the UI of Friendica is translated at [Transifex] [1] and then
included in the git repository at github. If you want to help with translation
for any language, be it correcting terms or translating friendica to a
currently not supported language, please register an account at transifex.com
and contact the friendica translation team there.
Translating friendica is simple. Just use the online tool at transifex. If you
don't want to deal with git & co. that is fine, we check the status of the
translations regularly and import them into the source tree at github so that
others can use them.
We do not include every translation from transifex in the source tree to avoid
a scattered and disturbed overall experience. As an uneducated guess we have a
lower limit of 50% translated strings before we include the language (for the
core message.po file, addont translation will be included once all strings of
an addon are translated. This limit is judging only by the amount of translated
strings under the assumption that the most prominent strings for the UI will be
translated first by a translation team. If you feel your translation useable
before this limit, please contact us and we will probably include your teams
work in the source tree.
If you want to get your work into the source tree yourself, feel free to do so
and contact us with and question that arises. The process is simple and
friendica ships with all the tools necessary.
The location of the translated files in the source tree is
/view/LNG-CODE/
where LNG-CODE is the language code used, e.g. de for German or fr for French.
For the email templates (the *.tpl files) just place them into the directory
and you are done. The translated strings come as a "message.po" file from
transifex which needs to be translated into the PHP file friendica uses. To do
so, place the file in the directory mentioned above and use the "po2php"
utility from the util directory of your friendica installation.
Assuming you want to convert the German localization which is placed in
view/de/message.po you would do the following.
1. Navigate at the command prompt to the base directory of your
friendica installation
2. Execute the po2php script, which will place the translation
in the strings.php file that is used by friendica.
$> php util/po2php.php view/de/message.po
The output of the script will be placed at view/de/strings.php where
froemdoca os expecting it, so you can test your translation mmediately.
3. Visit your friendica page to check if it still works in the language you
just translated. If not try to find the error, most likely PHP will give
you a hint in the log/warnings.about the error.
For debugging you can also try to "run" the file with PHP. This should
not give any output if the file is ok but might give a hint for
searching the bug in the file.
$> php view/de/strings.php
4. commit the two files with a meaningful commit message to your git
repository, push it to your fork of the friendica repository at github and
issue a pull request for that commit.
Utilities
---------
Additional to the po2php script there are some more utilities for translation
in the "util" directory of the friendica source tree. If you only want to
translate friendica into another language you wont need any of these tools most
likely but it gives you an idea how the translation process of friendica
works.
For further information see the utils/README file.
Known Problems
--------------
Friendica uses the language setting of the visitors browser to determain the
language for the UI. Most of the time this works, but there are some known
quirks.
One is that some browsers, like Safari, do the setting to "de-de" but friendica
only has a "de" localisation. A workaround would be to add a symbolic link
from
$friendica/view/de-de
pointing to
$friendica/view/de
[1]: https://www.transifex.com/projects/p/friendica/

View File

@ -166,7 +166,10 @@
case "json":
header ("Content-Type: application/json");
foreach($r as $rr)
return json_encode($rr);
$json = json_encode($rr);
if ($_GET['callback'])
$json = $_GET['callback']."(".$json.")";
return $json;
break;
case "rss":
header ("Content-Type: application/rss+xml");
@ -1835,7 +1838,17 @@
return($entities);
}
function api_format_items_embeded_images($item, $text){
$a = get_app();
$text = preg_replace_callback(
"|data:image/([^;]+)[^=]+=*|m",
function($match) use ($a, $item) {
return $a->get_baseurl()."/display/".$item['guid'];
},
$text);
return $text;
}
function api_format_items($r,$user_info, $filter_user = false) {
$a = get_app();
@ -1893,17 +1906,23 @@
//$statusbody = trim(html2plain(bbcode(api_clean_plain_items($item['body']), false, false, 5, true), 0));
$html = bbcode(api_clean_plain_items($item['body']), false, false, 2, true);
$statusbody = trim(html2plain($html, 0));
// handle data: images
$statusbody = api_format_items_embeded_images($item,$statusbody);
$statustitle = trim($item['title']);
if (($statustitle != '') and (strpos($statusbody, $statustitle) !== false))
$statustext = trim($statusbody);
else
$statustext = trim($statustitle."\n\n".$statusbody);
if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000))
$statustext = substr($statustext, 0, 1000)."... \n".$item["plink"];
$statushtml = trim(bbcode($item['body'], false, false));
$status = array(
'text' => $statustext,
'truncated' => False,
@ -1921,7 +1940,7 @@
//'attachments' => array(),
'user' => $status_user ,
//'entities' => NULL,
'statusnet_html' => trim(bbcode($item['body'], false, false)),
'statusnet_html' => $statushtml,
'statusnet_conversation_id' => $item['parent'],
);
@ -2243,13 +2262,6 @@
function api_direct_messages_box(&$a, $type, $box) {
if (api_user()===false) return false;
unset($_REQUEST["user_id"]);
unset($_GET["user_id"]);
unset($_REQUEST["screen_name"]);
unset($_GET["screen_name"]);
$user_info = api_get_user($a);
// params
$count = (x($_GET,'count')?$_GET['count']:20);
@ -2259,11 +2271,25 @@
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
$start = $page*$count;
$user_id = (x($_REQUEST,'user_id')?$_REQUEST['user_id']:"");
$screen_name = (x($_REQUEST,'screen_name')?$_REQUEST['screen_name']:"");
// caller user info
unset($_REQUEST["user_id"]);
unset($_GET["user_id"]);
unset($_REQUEST["screen_name"]);
unset($_GET["screen_name"]);
$user_info = api_get_user($a);
//$profile_url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
$profile_url = $user_info["url"];
// pagination
$start = $page*$count;
// filters
if ($box=="sentbox") {
$sql_extra = "`mail`.`from-url`='".dbesc( $profile_url )."'";
}
@ -2280,11 +2306,19 @@
if ($max_id > 0)
$sql_extra .= ' AND `mail`.`id` <= '.intval($max_id);
if ($user_id !="") {
$sql_extra .= ' AND `mail`.`contact-id` = ' . intval($user_id);
}
elseif($screen_name !=""){
$sql_extra .= " AND `contact`.`nick` = '" . dbesc($screen_name). "'";
}
$r = q("SELECT `mail`.*, `contact`.`nurl` AS `contact-url` FROM `mail`,`contact` WHERE `mail`.`contact-id` = `contact`.`id` AND `mail`.`uid`=%d AND $sql_extra AND `mail`.`id` > %d ORDER BY `mail`.`id` DESC LIMIT %d,%d",
intval(api_user()),
intval($since_id),
intval($start), intval($count)
);
$ret = Array();
foreach($r as $item) {
@ -2292,12 +2326,11 @@
$recipient = $user_info;
$sender = api_get_user($a,normalise_link($item['contact-url']));
}
elseif ($box == "sentbox" || $item['from-url'] != $profile_url){
elseif ($box == "sentbox" || $item['from-url'] == $profile_url){
$recipient = api_get_user($a,normalise_link($item['contact-url']));
$sender = $user_info;
}
$ret[]=api_format_messages($item, $recipient, $sender);
}
@ -2395,9 +2428,6 @@
function api_share_as_retweet($a, $uid, &$item) {
$body = trim($item["body"]);

View File

@ -282,6 +282,11 @@ function relative_date($posted_date,$format = null) {
return t('less than a second ago');
}
$time_append = '';
if ($etime >= 86400) {
$time_append = ' ('.$localtime.')';
}
$a = array( 12 * 30 * 24 * 60 * 60 => array( t('year'), t('years')),
30 * 24 * 60 * 60 => array( t('month'), t('months')),
7 * 24 * 60 * 60 => array( t('week'), t('weeks')),
@ -298,7 +303,7 @@ function relative_date($posted_date,$format = null) {
// translators - e.g. 22 hours ago, 1 minute ago
if(! $format)
$format = t('%1$d %2$s ago');
return sprintf( $format,$r, (($r == 1) ? $str[0] : $str[1]));
return sprintf( $format,$r, (($r == 1) ? $str[0] : $str[1])).$time_append;
}
}
}}

View File

@ -462,6 +462,7 @@ function db_definition() {
"bd" => array("type" => "date", "not null" => "1"),
"notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"ffi_keyword_blacklist" => array("type" => "mediumtext", "not null" => "1"),
),
"indexes" => array(
"PRIMARY" => array("id"),

View File

@ -872,7 +872,7 @@ function get_atom_elements($feed, $item, $contact = array()) {
}
if (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND $contact['fetch_further_information']) {
$res["body"] = $res["title"].add_page_info($res['plink'], false, "", true);
$res["body"] = $res["title"].add_page_info($res['plink'], false, "", ($contact['fetch_further_information'] == 2), $contact['ffi_keyword_blacklist']);
$res["title"] = "";
$res["object-type"] = ACTIVITY_OBJ_BOOKMARK;
} elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_OSTATUS))
@ -888,12 +888,8 @@ function get_atom_elements($feed, $item, $contact = array()) {
return $res;
}
function add_page_info($url, $no_photos = false, $photo = "", $keywords = false) {
require_once("mod/parse_url.php");
$data = parseurl_getsiteinfo($url, true);
logger('add_page_info: fetch page info for '.$url.' '.print_r($data, true), LOGGER_DEBUG);
function add_page_info_data($data) {
call_hooks('page_info_data', $data);
// It maybe is a rich content, but if it does have everything that a link has,
// then treat it that way
@ -921,11 +917,12 @@ function add_page_info($url, $no_photos = false, $photo = "", $keywords = false)
$text .= "[quote]".$data["text"]."[/quote]";
$hashtags = "";
if ($keywords AND isset($data["keywords"])) {
if (isset($data["keywords"]) AND count($data["keywords"])) {
$a = get_app();
$hashtags = "\n";
foreach ($data["keywords"] AS $keyword) {
$hashtag = str_replace(" ", "", $keyword);
$hashtag = str_replace(array(" ", "+", "/", ".", "#", "'"),
array("","", "", "", "", ""), $keyword);
$hashtags .= "#[url=".$a->get_baseurl()."/search?tag=".rawurlencode($hashtag)."]".$hashtag."[/url] ";
}
}
@ -933,6 +930,31 @@ function add_page_info($url, $no_photos = false, $photo = "", $keywords = false)
return("\n[class=type-".$data["type"]."]".$text."[/class]".$hashtags);
}
function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
require_once("mod/parse_url.php");
$data = parseurl_getsiteinfo($url, true);
logger('add_page_info: fetch page info for '.$url.' '.print_r($data, true), LOGGER_DEBUG);
if (!$keywords AND isset($data["keywords"]))
unset($data["keywords"]);
if (($keyword_blacklist != "") AND isset($data["keywords"])) {
$list = explode(",", $keyword_blacklist);
foreach ($list AS $keyword) {
$keyword = trim($keyword);
$index = array_search($keyword, $data["keywords"]);
if ($index !== false)
unset($data["keywords"][$index]);
}
}
$text = add_page_info_data($data);
return($text);
}
function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
logger('add_page_info_to_body: fetch page info for body '.$body, LOGGER_DEBUG);
@ -2587,34 +2609,10 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
// This is my contact on another system, but it's really me.
// Turn this into a wall post.
if($contact['remote_self']) {
if ($contact['remote_self'] == 2) {
$r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`", intval($importer['uid']));
if (count($r)) {
$datarray['contact-id'] = $r[0]["id"];
$datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"];
$datarray['owner-avatar'] = $r[0]["photo"];
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];
$datarray['author-avatar'] = $datarray['owner-avatar'];
}
}
if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
$datarray["app"] = network_to_name($contact['network']);
$notify = true;
if($contact['network'] === NETWORK_FEED) {
$datarray['private'] = 0;
}
} else
$notify = false;
$notify = item_is_remote_self($contact, $datarray);
$r = item_store($datarray, false, $notify);
logger('Stored - Contact '.$contact['url'].' Notify '.$notify.' return '.$r.' Item '.print_r($datarray, true), LOGGER_DEBUG);
continue;
}
@ -2622,10 +2620,69 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
}
function item_is_remote_self($contact, &$datarray) {
$a = get_app();
if (!$contact['remote_self'])
return false;
// Prevent the forwarding of posts that are forwarded
if ($datarray["extid"] == NETWORK_DFRN)
return false;
// Prevent to forward already forwarded posts
if ($datarray["app"] == $a->get_hostname())
return false;
if (($contact['network'] != NETWORK_FEED) AND $datarray['private'])
return false;
$datarray2 = $datarray;
logger('remote-self start - Contact '.$contact['url'].' - '.$contact['remote_self'].' Item '.print_r($datarray, true), LOGGER_DEBUG);
if ($contact['remote_self'] == 2) {
$r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`",
intval($contact['uid']));
if (count($r)) {
$datarray['contact-id'] = $r[0]["id"];
$datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"];
$datarray['owner-avatar'] = $r[0]["avatar"];
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];
$datarray['author-avatar'] = $datarray['owner-avatar'];
}
if ($contact['network'] != NETWORK_FEED) {
$datarray["guid"] = get_guid(32);
unset($datarray["plink"]);
$datarray["uri"] = item_new_uri($a->get_hostname(),$contact['uid']);
$datarray["parent-uri"] = $datarray["uri"];
$datarray["extid"] = $contact['network'];
$urlpart = parse_url($datarray2['author-link']);
$datarray["app"] = $urlpart["host"];
} else
$datarray['private'] = 0;
}
//if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
// $datarray["app"] = network_to_name($contact['network']);
if ($contact['network'] != NETWORK_FEED) {
// Store the original post
$r = item_store($datarray2, false, false);
logger('remote-self post original item - Contact '.$contact['url'].' return '.$r.' Item '.print_r($datarray2, true), LOGGER_DEBUG);
} else
$datarray["app"] = "Feed";
return true;
}
function local_delivery($importer,$data) {
$a = get_app();
logger(__function__, LOGGER_TRACE);
logger(__function__, LOGGER_TRACE);
if($importer['readonly']) {
// We aren't receiving stuff from this person. But we will quietly ignore them
@ -3703,27 +3760,7 @@ function local_delivery($importer,$data) {
// This is my contact on another system, but it's really me.
// Turn this into a wall post.
if($importer['remote_self']) {
if ($importer['remote_self'] == 2) {
$r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`",
intval($importer['importer_uid']));
if (count($r)) {
$datarray['contact-id'] = $r[0]["id"];
$datarray['owner-name'] = $r[0]["name"];
$datarray['owner-link'] = $r[0]["url"];
$datarray['owner-avatar'] = $r[0]["photo"];
$datarray['author-name'] = $datarray['owner-name'];
$datarray['author-link'] = $datarray['owner-link'];
$datarray['author-avatar'] = $datarray['owner-avatar'];
}
}
$notify = true;
} else
$notify = false;
$notify = item_is_remote_self($importer, $datarray);
$posted_id = item_store($datarray, false, $notify);

View File

@ -189,8 +189,8 @@ function create_user($arr) {
$spubkey = $sres['pubkey'];
$r = q("INSERT INTO `user` ( `guid`, `username`, `password`, `email`, `openid`, `nickname`,
`pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone`, `service_class` )
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC', '%s' )",
`pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone`, `service_class`, `default-location` )
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC', '%s', '' )",
dbesc(generate_user_guid()),
dbesc($username),
dbesc($new_password_encoded),

View File

@ -53,6 +53,13 @@ if(!$install) {
load_config('config');
load_config('system');
if (get_config('system','force_ssl') AND ($a->get_scheme() == "http") AND
(intval(get_config('system','ssl_policy')) == SSL_POLICY_FULL) AND
(substr($a->get_baseurl(), 0, 8) == "https://")) {
header("HTTP/1.1 302 Moved Temporarily");
header("location: ".$a->get_baseurl()."/".$a->query_string);
}
require_once("include/session.php");
load_hooks();
call_hooks('init_1');

View File

@ -354,6 +354,7 @@ function admin_page_site_post(&$a){
$ostatus_poll_interval = ((x($_POST,'ostatus_poll_interval')) ? intval(trim($_POST['ostatus_poll_interval'])) : 0);
$diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False);
$ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0);
$force_ssl = ((x($_POST,'force_ssl')) ? True : False);
$old_share = ((x($_POST,'old_share')) ? True : False);
$hide_help = ((x($_POST,'hide_help')) ? True : False);
$suppress_language = ((x($_POST,'suppress_language')) ? True : False);
@ -481,6 +482,7 @@ function admin_page_site_post(&$a){
set_config('system','diaspora_enabled', $diaspora_enabled);
set_config('config','private_addons', $private_addons);
set_config('system','force_ssl', $force_ssl);
set_config('system','old_share', $old_share);
set_config('system','hide_help', $hide_help);
set_config('system','use_fulltext_engine', $use_fulltext_engine);
@ -603,6 +605,7 @@ function admin_page_site(&$a) {
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
'$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile),
'$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices),
'$force_ssl' => array('force_ssl', t("Force SSL"), get_config('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")),
'$old_share' => array('old_share', t("Old style 'Share'"), get_config('system','old_share'), t("Deactivates the bbcode element 'share' for repeating items.")),
'$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")),
'$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names),

View File

@ -160,6 +160,8 @@ function contacts_post(&$a) {
$fetch_further_information = intval($_POST['fetch_further_information']);
$ffi_keyword_blacklist = fix_mce_lf(escape_tags(trim($_POST['ffi_keyword_blacklist'])));
$priority = intval($_POST['poll']);
if($priority > 5 || $priority < 0)
$priority = 0;
@ -167,13 +169,15 @@ function contacts_post(&$a) {
$info = fix_mce_lf(escape_tags(trim($_POST['info'])));
$r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s',
`hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d WHERE `id` = %d AND `uid` = %d",
`hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d,
`ffi_keyword_blacklist` = '%s' WHERE `id` = %d AND `uid` = %d",
intval($profile_id),
intval($priority),
dbesc($info),
intval($hidden),
intval($notify),
intval($fetch_further_information),
dbesc($ffi_keyword_blacklist),
intval($contact_id),
intval(local_user())
);
@ -388,7 +392,7 @@ function contacts_content(&$a) {
$dir_icon = 'images/larrow.gif';
$relation_text = t('You are sharing with %s');
break;
case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif';
$relation_text = t('%s is sharing with you');
@ -502,7 +506,10 @@ function contacts_content(&$a) {
'$archived' => (($contact['archive']) ? t('Currently archived') : ''),
'$hidden' => array('hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')),
'$notify' => array('notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')),
'$fetch_further_information' => array('fetch_further_information', t('Fetch further information for feeds'), ($contact['fetch_further_information'] == 1), t('Fetch further information for feeds')),
'$fetch_further_information' => array('fetch_further_information', t('Fetch further information for feeds'), $contact['fetch_further_information'], t('Fetch further information for feeds'),
array('0'=>t('Disabled'), '1'=>t('Fetch information'), '2'=>t('Fetch information and keywords'))),
'$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'],
'$ffi_keyword_blacklist' => array('ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')),
'$photo' => $contact['photo'],
'$name' => $contact['name'],
'$dir_icon' => $dir_icon,
@ -684,10 +691,10 @@ function contacts_content(&$a) {
);
}
}
$tpl = get_markup_template("contacts-template.tpl");
$o .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),

View File

@ -152,9 +152,14 @@ function crepair_content(&$a) {
// Disable remote self for everything except feeds.
// There is an issue when you repeat an item from maybe twitter and you got comments from friendica and twitter
// Problem is, you couldn't reply to both networks.
if ($contact['network'] != NETWORK_FEED)
if (!in_array($contact['network'], array(NETWORK_FEED, NETWORK_DFRN, NETWORK_DIASPORA)))
$allow_remote_self = false;
if ($contact['network'] == NETWORK_FEED)
$remote_self_options = array('0'=>t('No mirroring'), '1'=>t('Mirror as forwarded posting'), '2'=>t('Mirror as my own posting'));
else
$remote_self_options = array('0'=>t('No mirroring'), '2'=>t('Mirror as my own posting'));
$tpl = get_markup_template('crepair.tpl');
$o .= replace_macros($tpl, array(
'$label_name' => t('Name'),
@ -168,7 +173,7 @@ function crepair_content(&$a) {
'$label_photo' => t('New photo from this URL'),
'$label_remote_self' => t('Remote Self'),
'$allow_remote_self' => $allow_remote_self,
'$remote_self' => array('remote_self', t('Mirror postings from this contact'), $contact['remote_self'], t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), array('0'=>t('No mirroring'), '1'=>t('Mirror as forwarded posting'), '2'=>t('Mirror as my own posting'))),
'$remote_self' => array('remote_self', t('Mirror postings from this contact'), $contact['remote_self'], t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), $remote_self_options),
'$contact_name' => $contact['name'],
'$contact_nick' => $contact['nick'],
'$contact_id' => $contact['id'],

View File

@ -648,12 +648,8 @@ function dfrn_request_content(&$a) {
if(! local_user()) {
info( t("Please login to confirm introduction.") . EOL );
/* setup the return URL to come back to this page if they use openid */
$stripped = str_replace('q=','',$a->query_string);
$_SESSION['return_url'] = trim($stripped,'/');
$_SESSION['return_url'] = $a->query_string;
return login();
}

View File

@ -137,6 +137,7 @@ function item_post(&$a) {
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
$post_id = ((x($_REQUEST,'post_id')) ? intval($_REQUEST['post_id']) : 0);
$app = ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : '');
$extid = ((x($_REQUEST,'extid')) ? strip_tags($_REQUEST['extid']) : '');
$allow_moderated = false;
@ -200,7 +201,7 @@ function item_post(&$a) {
$verb = $orig_post['verb'];
$objecttype = $orig_post['object-type'];
$emailcc = $orig_post['emailcc'];
$app = $orig_post['app'];
$app = $orig_post['app'];
$categories = $orig_post['file'];
$title = notags(trim($_REQUEST['title']));
$body = escape_tags(trim($_REQUEST['body']));
@ -208,6 +209,7 @@ function item_post(&$a) {
$pubmail_enable = $orig_post['pubmail'];
$network = $orig_post['network'];
$guid = $orig_post['guid'];
$extid = $orig_post['extid'];
} else {
@ -652,6 +654,7 @@ function item_post(&$a) {
$datarray['commented'] = datetime_convert();
$datarray['received'] = datetime_convert();
$datarray['changed'] = datetime_convert();
$datarray['extid'] = $extid;
$datarray['guid'] = $guid;
$datarray['uri'] = $uri;
$datarray['title'] = $title;
@ -749,11 +752,12 @@ function item_post(&$a) {
$post_id = 0;
$r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`, `network`, `contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
$r = q("INSERT INTO `item` (`guid`, `extid`, `uid`,`type`,`wall`,`gravity`, `network`, `contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `commented`, `received`, `changed`, `uri`, `thr-parent`, `title`, `body`, `app`, `location`, `coord`,
`tag`, `inform`, `verb`, `object-type`, `postopts`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach`, `bookmark`,`origin`, `moderated`, `file` )
VALUES( '%s', %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s' )",
VALUES( '%s', '%s', %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s' )",
dbesc($datarray['guid']),
dbesc($datarray['extid']),
intval($datarray['uid']),
dbesc($datarray['type']),
intval($datarray['wall']),

View File

@ -16,9 +16,10 @@ function network_init(&$a) {
}
}
// convert query string to array and remove first element (which is friendica args)
// convert query string to array. remove friendica args
$query_array = array();
parse_str($a->query_string, $query_array);
$query_string = str_replace($a->cmd."?", "", $a->query_string);
parse_str($query_string, $query_array);
array_shift($query_array);
// fetch last used network view and redirect if needed
@ -297,11 +298,11 @@ function network_content(&$a, $update = 0) {
if(! local_user()) {
$_SESSION['return_url'] = $a->query_string;
return login(false);
return login(false);
}
// TODO:is this really necessary? $a is already available to hooks
$arr = array('query' => $a->query_string);
call_hooks('network_content_init', $arr);

View File

@ -333,6 +333,8 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
logger("parseurl_getsiteinfo: Siteinfo for ".$url." ".print_r($siteinfo, true), LOGGER_DEBUG);
call_hooks('getsiteinfo', $siteinfo);
return($siteinfo);
}
@ -410,6 +412,13 @@ function parse_url_content(&$a) {
$siteinfo = parseurl_getsiteinfo($url);
// if ($textmode) {
// require_once("include/items.php");
//
// echo add_page_info_data($siteinfo);
// killme();
// }
$url= $siteinfo["url"];
$sitedata = "";

View File

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1173 );
define( 'UPDATE_VERSION' , 1174 );
/**
*

File diff suppressed because it is too large Load Diff

View File

@ -51,6 +51,7 @@ do
if [ ! -d "$f" ]
then
xgettext $KEYWORDS $OPTS -j -o "$OUTFILE" --from-code=UTF-8 "$f"
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
fi
done

View File

@ -7,6 +7,7 @@
# abinoam <abinoam@gmail.com>, 2012
# Frederico Gonçalves Guimarães <frederico@teia.bio.br>, 2011
# Frederico Gonçalves Guimarães <frederico@teia.bio.br>, 2011
# Calango Jr <jcsojr@gmail.com>, 2014
# Frederico Gonçalves Guimarães <frederico@teia.bio.br>, 2011-2013
# Frederico Gonçalves Guimarães <frederico@teia.bio.br>, 2011
# Frederico Gonçalves Guimarães <frederico@teia.bio.br>, 2011-2013
@ -21,8 +22,8 @@ msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-07 14:32+0200\n"
"PO-Revision-Date: 2014-09-08 10:08+0000\n"
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
"PO-Revision-Date: 2014-10-04 04:17+0000\n"
"Last-Translator: Calango Jr <jcsojr@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/friendica/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -531,7 +532,7 @@ msgstr "Página web:"
#: ../../boot.php:1657
msgid "Network:"
msgstr ""
msgstr "Rede:"
#: ../../boot.php:1687 ../../boot.php:1773
msgid "g A l F d"
@ -765,11 +766,11 @@ msgstr "Capacidade de marcar publicações especiais com uma estrela indicadora"
#: ../../include/features.php:63
msgid "Mute Post Notifications"
msgstr ""
msgstr "Silenciar Notificações de Postagem"
#: ../../include/features.php:63
msgid "Ability to mute notifications for a thread"
msgstr ""
msgstr "Habilitar notificação silenciosa para a tarefa"
#: ../../include/items.php:2090 ../../include/datetime.php:472
#, php-format
@ -1126,21 +1127,21 @@ msgstr "Favor visitar %s para aprovar ou rejeitar a apresentação."
#: ../../include/enotify.php:238
msgid "[Friendica:Notify] A new person is sharing with you"
msgstr ""
msgstr "[Friendica:Notificação] Uma nova pessoa está compartilhando com você"
#: ../../include/enotify.php:239 ../../include/enotify.php:240
#, php-format
msgid "%1$s is sharing with you at %2$s"
msgstr ""
msgstr "%1$s está compartilhando com você via %2$s"
#: ../../include/enotify.php:246
msgid "[Friendica:Notify] You have a new follower"
msgstr ""
msgstr "[Friendica:Notificação] Você tem um novo seguidor"
#: ../../include/enotify.php:247 ../../include/enotify.php:248
#, php-format
msgid "You have a new follower at %2$s : %1$s"
msgstr ""
msgstr "Você tem um novo seguidor em %2$s : %1$s"
#: ../../include/enotify.php:261
msgid "[Friendica:Notify] Friend suggestion received"
@ -1172,17 +1173,17 @@ msgstr "Favor visitar %s para aprovar ou rejeitar a sugestão."
#: ../../include/enotify.php:280 ../../include/enotify.php:293
msgid "[Friendica:Notify] Connection accepted"
msgstr ""
msgstr "[Friendica:Notificação] Conexão aceita"
#: ../../include/enotify.php:281 ../../include/enotify.php:294
#, php-format
msgid "'%1$s' has acepted your connection request at %2$s"
msgstr ""
msgstr "'%1$s' sua solicitação de conexão foi aceita em %2$s"
#: ../../include/enotify.php:282 ../../include/enotify.php:295
#, php-format
msgid "%2$s has accepted your [url=%1$s]connection request[/url]."
msgstr ""
msgstr "%2$s Foi aceita [url=%1$s] a conexão solicitada[/url]."
#: ../../include/enotify.php:285
msgid ""
@ -1364,7 +1365,7 @@ msgstr "Terminar esta sessão"
#: ../../include/nav.php:79
msgid "Your videos"
msgstr ""
msgstr "Seus vídeos"
#: ../../include/nav.php:81
msgid "Your personal notes"

View File

@ -103,7 +103,7 @@ $a->strings["Location:"] = "Localização:";
$a->strings["Gender:"] = "Gênero:";
$a->strings["Status:"] = "Situação:";
$a->strings["Homepage:"] = "Página web:";
$a->strings["Network:"] = "";
$a->strings["Network:"] = "Rede:";
$a->strings["g A l F d"] = "G l d F";
$a->strings["F d"] = "F d";
$a->strings["[today]"] = "[hoje]";
@ -161,8 +161,8 @@ $a->strings["Dislike Posts"] = "Desgostar de publicações";
$a->strings["Ability to dislike posts/comments"] = "Capacidade de desgostar de publicações/comentários";
$a->strings["Star Posts"] = "Destacar publicações";
$a->strings["Ability to mark special posts with a star indicator"] = "Capacidade de marcar publicações especiais com uma estrela indicadora";
$a->strings["Mute Post Notifications"] = "";
$a->strings["Ability to mute notifications for a thread"] = "";
$a->strings["Mute Post Notifications"] = "Silenciar Notificações de Postagem";
$a->strings["Ability to mute notifications for a thread"] = "Habilitar notificação silenciosa para a tarefa";
$a->strings["%s's birthday"] = "aniversários de %s's";
$a->strings["Happy Birthday %s"] = "Feliz Aniversário %s";
$a->strings["[Name Withheld]"] = "[Nome não revelado]";
@ -239,19 +239,19 @@ $a->strings["You've received an introduction from '%1\$s' at %2\$s"] = "Você re
$a->strings["You've received [url=%1\$s]an introduction[/url] from %2\$s."] = "Você recebeu [url=%1\$s]uma apresentação[/url] de %2\$s.";
$a->strings["You may visit their profile at %s"] = "Você pode visitar o perfil deles em %s";
$a->strings["Please visit %s to approve or reject the introduction."] = "Favor visitar %s para aprovar ou rejeitar a apresentação.";
$a->strings["[Friendica:Notify] A new person is sharing with you"] = "";
$a->strings["%1\$s is sharing with you at %2\$s"] = "";
$a->strings["[Friendica:Notify] You have a new follower"] = "";
$a->strings["You have a new follower at %2\$s : %1\$s"] = "";
$a->strings["[Friendica:Notify] A new person is sharing with you"] = "[Friendica:Notificação] Uma nova pessoa está compartilhando com você";
$a->strings["%1\$s is sharing with you at %2\$s"] = "%1\$s está compartilhando com você via %2\$s";
$a->strings["[Friendica:Notify] You have a new follower"] = "[Friendica:Notificação] Você tem um novo seguidor";
$a->strings["You have a new follower at %2\$s : %1\$s"] = "Você tem um novo seguidor em %2\$s : %1\$s";
$a->strings["[Friendica:Notify] Friend suggestion received"] = "[Friendica:Notify] Você recebeu uma sugestão de amigo";
$a->strings["You've received a friend suggestion from '%1\$s' at %2\$s"] = "Você recebeu uma sugestão de amigo de '%1\$s' em %2\$s";
$a->strings["You've received [url=%1\$s]a friend suggestion[/url] for %2\$s from %3\$s."] = "Você recebeu [url=%1\$s]uma sugestão de amigo[/url] de %2\$s em %3\$s";
$a->strings["Name:"] = "Nome:";
$a->strings["Photo:"] = "Foto:";
$a->strings["Please visit %s to approve or reject the suggestion."] = "Favor visitar %s para aprovar ou rejeitar a sugestão.";
$a->strings["[Friendica:Notify] Connection accepted"] = "";
$a->strings["'%1\$s' has acepted your connection request at %2\$s"] = "";
$a->strings["%2\$s has accepted your [url=%1\$s]connection request[/url]."] = "";
$a->strings["[Friendica:Notify] Connection accepted"] = "[Friendica:Notificação] Conexão aceita";
$a->strings["'%1\$s' has acepted your connection request at %2\$s"] = "'%1\$s' sua solicitação de conexão foi aceita em %2\$s";
$a->strings["%2\$s has accepted your [url=%1\$s]connection request[/url]."] = "%2\$s Foi aceita [url=%1\$s] a conexão solicitada[/url].";
$a->strings["You are now mutual friends and may exchange status updates, photos, and email\n\twithout restriction."] = "";
$a->strings["Please visit %s if you wish to make any changes to this relationship."] = "";
$a->strings["'%1\$s' has chosen to accept you a \"fan\", which restricts some forms of communication - such as private messaging and some profile interactions. If this is a celebrity or community page, these settings were applied automatically."] = "";
@ -292,7 +292,7 @@ $a->strings["School/education:"] = "Escola/educação:";
$a->strings["Nothing new here"] = "Nada de novo aqui";
$a->strings["Clear notifications"] = "Descartar notificações";
$a->strings["End this session"] = "Terminar esta sessão";
$a->strings["Your videos"] = "";
$a->strings["Your videos"] = "Seus vídeos";
$a->strings["Your personal notes"] = "";
$a->strings["Sign in"] = "Entrar";
$a->strings["Home Page"] = "Página pessoal";

View File

@ -5,14 +5,14 @@
# Translators:
# Arian - Cazare Muncitori <arianserv@gmail.com>, 2014
# Doru DEACONU <dumitrudeaconu@yahoo.com>, 2013
# Doru DEACONU <dumitrudeaconu@yahoo.com>, 2013
# Doru DEACONU <dumitrudeaconu@yahoo.com>, 2013-2014
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-07 14:32+0200\n"
"PO-Revision-Date: 2014-09-08 10:08+0000\n"
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
"PO-Revision-Date: 2014-10-09 12:35+0000\n"
"Last-Translator: Doru DEACONU <dumitrudeaconu@yahoo.com>\n"
"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -521,7 +521,7 @@ msgstr "Homepage:"
#: ../../boot.php:1657
msgid "Network:"
msgstr ""
msgstr "Reţea:"
#: ../../boot.php:1687 ../../boot.php:1773
msgid "g A l F d"
@ -2963,7 +2963,7 @@ msgstr ""
#: ../../object/Item.php:213
msgid "ignored"
msgstr ""
msgstr "ignorat"
#: ../../object/Item.php:220 ../../mod/content.php:759
msgid "add tag"

View File

@ -103,7 +103,7 @@ $a->strings["Location:"] = "Locaţie:";
$a->strings["Gender:"] = "Sex:";
$a->strings["Status:"] = "Status:";
$a->strings["Homepage:"] = "Homepage:";
$a->strings["Network:"] = "";
$a->strings["Network:"] = "Reţea:";
$a->strings["g A l F d"] = "g A l F d";
$a->strings["F d"] = "F d";
$a->strings["[today]"] = "[azi]";
@ -675,7 +675,7 @@ $a->strings["starred"] = "cu steluță";
$a->strings["ignore thread"] = "";
$a->strings["unignore thread"] = "";
$a->strings["toggle ignore status"] = "";
$a->strings["ignored"] = "";
$a->strings["ignored"] = "ignorat";
$a->strings["add tag"] = "add tag";
$a->strings["I like this (toggle)"] = "I like asta (toggle)";
$a->strings["like"] = "like";

View File

@ -51,6 +51,7 @@
{{include file="field_select.tpl" field=$theme}}
{{include file="field_select.tpl" field=$theme_mobile}}
{{include file="field_select.tpl" field=$ssl_policy}}
{{if $ssl_policy.2 == 1}}{{include file="field_checkbox.tpl" field=$force_ssl}}{{/if}}
{{include file="field_checkbox.tpl" field=$old_share}}
{{include file="field_checkbox.tpl" field=$hide_help}}
{{include file="field_select.tpl" field=$singleuser}}

View File

@ -66,7 +66,8 @@
{{/if}}
<div id="contact-edit-end" ></div>
{{include file="field_checkbox.tpl" field=$notify}}
{{include file="field_checkbox.tpl" field=$fetch_further_information}}
{{include file="field_select.tpl" field=$fetch_further_information}}
{{if $fetch_further_information.2 == 2 }} {{include file="field_textarea.tpl" field=$ffi_keyword_blacklist}} {{/if}}
{{include file="field_checkbox.tpl" field=$hidden}}
<div id="contact-edit-info-wrapper">