diff --git a/boot.php b/boot.php
index 2a8dc3d047..c2690f6ef0 100755
--- a/boot.php
+++ b/boot.php
@@ -9,9 +9,9 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1297' );
+define ( 'FRIENDICA_VERSION', '2.3.1299' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1133 );
+define ( 'DB_UPDATE_VERSION', 1134 );
define ( 'EOL', " \r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -293,6 +293,8 @@ class App {
public $nav_sel;
+ public $category;
+
private $scheme;
private $hostname;
private $baseurl;
@@ -377,6 +379,9 @@ class App {
$this->argc = count($this->argv);
if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) {
$this->module = str_replace(".", "_", $this->argv[0]);
+ if(array_key_exists('2',$this->argv)) {
+ $this->category = $this->argv[2];
+ }
}
else {
$this->argc = 1;
@@ -984,6 +989,12 @@ function profile_sidebar($profile, $block = 0) {
if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
$connect = False;
+ if(get_my_url() && $profile['unkmail'])
+ $wallmessage = t('Message');
+ else
+ $wallmessage = false;
+
+
// show edit profile to yourself
if ($profile['uid'] == local_user()) {
@@ -1066,6 +1077,7 @@ function profile_sidebar($profile, $block = 0) {
$o .= replace_macros($tpl, array(
'$profile' => $profile,
'$connect' => $connect,
+ '$wallmessage' => $wallmessage,
'$location' => template_escape($location),
'$gender' => $gender,
'$pdesc' => $pdesc,
@@ -1313,8 +1325,12 @@ function feed_birthday($uid,$tz) {
*
*/
+
$birthday = '';
+ if(! strlen($tz))
+ $tz = 'UTC';
+
$p = q("SELECT `dob` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
intval($uid)
);
diff --git a/database.sql b/database.sql
index 327b482c06..a271e5491c 100755
--- a/database.sql
+++ b/database.sql
@@ -289,9 +289,10 @@ CREATE TABLE IF NOT EXISTS `mail` (
`convid` int(10) unsigned NOT NULL,
`title` char(255) NOT NULL,
`body` mediumtext NOT NULL,
- `seen` tinyint(1) NOT NULL,
+ `seen` tinyint(1) NOT NULL DEFAULT '0',
`reply` tinyint(1) NOT NULL DEFAULT '0',
- `replied` tinyint(1) NOT NULL,
+ `replied` tinyint(1) NOT NULL DEFAULT '0',
+ `unknown` tinyint(1) NOT NULL DEFAULT '0',
`uri` char(255) NOT NULL,
`parent-uri` char(255) NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -300,6 +301,7 @@ CREATE TABLE IF NOT EXISTS `mail` (
KEY `guid` (`guid`),
KEY `convid` (`convid`),
KEY `reply` (`reply`),
+ KEY `unknown` (`unknown`),
KEY `uri` (`uri`),
KEY `parent-uri` (`parent-uri`),
KEY `created` (`created`)
@@ -453,6 +455,8 @@ CREATE TABLE IF NOT EXISTS `user` (
`blockwall` tinyint(1) unsigned NOT NULL DEFAULT '0',
`hidewall` tinyint(1) unsigned NOT NULL DEFAULT '0',
`blocktags` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ `unkmail` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ `cntunkmail` int(11) unsigned NOT NULL DEFAULT '10',
`notify-flags` int(11) unsigned NOT NULL DEFAULT '65535',
`page-flags` int(11) unsigned NOT NULL DEFAULT '0',
`prvnets` tinyint(1) NOT NULL DEFAULT '0',
@@ -472,6 +476,8 @@ CREATE TABLE IF NOT EXISTS `user` (
KEY `account_expired` (`account_expired`),
KEY `hidewall` (`hidewall`),
KEY `blockwall` (`blockwall`),
+ KEY `unkmail` (`unkmail`),
+ KEY `cntunkmail` (`cntunkmail`),
KEY `blocked` (`blocked`),
KEY `verified` (`verified`),
KEY `login_date` (`login_date`)
diff --git a/doc/Home.md b/doc/Home.md
index 56abe8075c..30efc93f7d 100755
--- a/doc/Home.md
+++ b/doc/Home.md
@@ -5,6 +5,7 @@ Friendica Documentation and Resources
**Contents**
* [Account Basics](help/Account-Basics)
+* [New User Quick Start](help/guide)
* [Profiles](help/Profiles)
* [Connectors](help/Connectors)
* [Making Friends](help/Making-Friends)
diff --git a/doc/andfinally.md b/doc/andfinally.md
new file mode 100644
index 0000000000..cd8a6994ba
--- /dev/null
+++ b/doc/andfinally.md
@@ -0,0 +1,24 @@
+And that brings the Quick Start to an end.
+
+Here are some more things to help get you started:
+
+**Groups**
+
+
+- New Here - a group for people new to Friendica
+
+- Friendica Support - problems? This is the place to ask.
+
+- Public Stream - a place to talk about anything to anyone.
+
+- Let's Talk a group for finding people and groups who share similar interests.
+
+- Local Friendica a page for local Friendica groups
+
+
+**Documentation**
+
+- Connecting to more networks
+- Help Index
+
+
diff --git a/doc/groupsandpages.md b/doc/groupsandpages.md
new file mode 100644
index 0000000000..418e682c83
--- /dev/null
+++ b/doc/groupsandpages.md
@@ -0,0 +1,11 @@
+This is the global directory. If you get lost, you can click this link to bring yourself back here.
+
+On this page, you'll find a collection of groups, forums and celebrity pages. Groups are not real people. Connecting to them is similar to "liking" something on Facebook, or signing up for a new forum. You don't have to feel awkward about introducing yourself to a new person, because they're not people!
+
+When you connect to a group, all messages to that group will start appearing in your network tab. You can comment on these posts, or post to the group yourself without ever having to add any of the groups members. This is a great way to make friends dynamically - you'll find people you like and add each other naturally instead of adding random strangers. Simply find a group you're interested in, and connect to it the same way you did with people in the last section. There are a lot of groups, and you're likely to get lost. Remember the link at the top of this page will bring you back here.
+
+Once you've added some groups, move on to the next section.
+
+
+
+
diff --git a/doc/guide.md b/doc/guide.md
new file mode 100644
index 0000000000..178170c4e2
--- /dev/null
+++ b/doc/guide.md
@@ -0,0 +1,13 @@
+First things first, let's make sure you're logged in to your account. If you're not already logged in, do so in the frame below.
+
+Once you've logged in (or if you are already logged in), you'll now be looking at your profile page.
+
+This is a bit like your Facebook wall. It's where all your status messgages are kept, and where your friends come to post on your wall. To write your status, simply click in the box that says "share". When you do this, the box will expand. You can see some formatting options at the top such as Bold, Italics and Underline, as well as ways to add links and pictures. At the bottom you'll find some more links. You can use these to upload pictures and files from your computer, share websites with a bit of preview text, or embed video and audio files from elsewhere on the web. You can also set your post location here.
+
+Once you've finished writing your post, click on the padlock icon to select who can see it. If you do not use the padlock icon, your post will be public. This means it will appear to anybody who views your profile, and in the community tab if your site has it enabled, as well as in the network tab of any of your contacts.
+
+Play around with this a bit, then when you're ready to move on, we'll take a look at the Network Tab
+
+
+
+
diff --git a/doc/makingnewfriends.md b/doc/makingnewfriends.md
new file mode 100644
index 0000000000..35befaa365
--- /dev/null
+++ b/doc/makingnewfriends.md
@@ -0,0 +1,11 @@
+This is your Suggested Friends page. If you get lost, you can click this link to bring yourself back here.
+
+This is a bit like the Friend Suggestions page of Facebook. Everybody on this list has agreed that they may be suggested as a friend. This means they're unlikely to refuse an introduction you send, and they want to meet new people too!
+
+See somebody you like the look of? Click the connect button beneath their photograph. This will bring you to the introductions page. Fill in the form as instructed, and add a small note (optional). Now, wait a bit and they'll accept your request - note that these are real people, and it might take a while. Now you've added one, you're probably lost. Click the link at the top of this page to go back to the suggested friends list and add some more.
+
+Feel uncomfortable adding people you don't know? Don't worry - that's where Groups and Pages come in!
+
+
+
+
diff --git a/doc/network.md b/doc/network.md
new file mode 100644
index 0000000000..f445b0055e
--- /dev/null
+++ b/doc/network.md
@@ -0,0 +1,9 @@
+This is your Network Tab. If you get lost, you can click this link to bring yourself back here.
+
+This is a bit like the Newsfeed at Facebook or the Stream at Diaspora. It's where all the posts from your contacts, groups, and feeds will appear. If you're new, you won't see anything in this page, unless you posted your status in the last step. If you've already added a few friends, you'll be able to see their posts. Here, you can comment, like, or dislike posts, or click on somebody's name to visit their profile page where you can write on their wall.
+
+Now we need to fill it up, the first step, is to add people you already know from Facebook.
+
+
+
+
diff --git a/doc/peopleyouknow.md b/doc/peopleyouknow.md
new file mode 100644
index 0000000000..143c492176
--- /dev/null
+++ b/doc/peopleyouknow.md
@@ -0,0 +1,13 @@
+This is your connector settings page. If you get lost, you can click this link to bring yourself back here.
+
+This is the bit that makes Friendica unique. You can connect to anybody on the internet from your Friendica account using this page! The available connectors varies depending on which plugins you have installed, but for now, we'll walk you through Facebook. Note that not all servers have the Facebook connector installed. If you can't find it in the list below, don't worry, we'll look at ways of connecting to more people in the following pages.
+
+The biggest of all social networks is Facebook. Fortunately, this connector is really easy. Scroll down the page, and click Facebook Connector Settings. Enter your Facebook user name and password and let the application (the connector) do everything the options suggest. You can fine tune this or experiment with the other connectors too. If you need help, you can always ask at Friendica Support or see the instructions here.
+
+When you're ready, we can move on to making new friends.
+
+
+
+
+
+
diff --git a/include/api.php b/include/api.php
index 64772d6575..065f14cffb 100755
--- a/include/api.php
+++ b/include/api.php
@@ -83,7 +83,7 @@
$record = $r[0];
} else {
logger('API_login failure: ' . print_r($_SERVER,true), LOGGER_DEBUG);
- header('WWW-Authenticate: Basic realm="Friendika"');
+ header('WWW-Authenticate: Basic realm="Friendica"');
header('HTTP/1.0 401 Unauthorized');
die('This api requires login');
}
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index 1f70e536f2..e0f37f078f 100755
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -87,7 +87,7 @@ function fileas_widget($baseurl,$selected = '') {
$cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
- $unescaped = file_tag_decode($mtch[1]);
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
$terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
@@ -103,3 +103,31 @@ function fileas_widget($baseurl,$selected = '') {
));
}
+function categories_widget($baseurl,$selected = '') {
+ $a = get_app();
+
+ $saved = get_pconfig($a->profile['profile_uid'],'system','filetags');
+ if(! strlen($saved))
+ return;
+
+ $matches = false;
+ $terms = array();
+ $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
+ $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+ }
+ }
+
+ return replace_macros(get_markup_template('categories_widget.tpl'),array(
+ '$title' => t('Categories'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => $baseurl,
+
+ ));
+}
+
diff --git a/include/conversation.php b/include/conversation.php
index a9fb807add..df92a40ed0 100755
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -250,7 +250,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$threads = array();
$threadsid = -1;
- if(count($items)) {
+ if($items && count($items)) {
if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
@@ -974,6 +974,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$shortnoloc' => t('clear location'),
'$title' => "",
'$placeholdertitle' => t('Set title'),
+ '$category' => "",
+ '$placeholdercategory' => t('Categories (comma-separated list)'),
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
'$shortpermset' => t('permissions'),
diff --git a/include/diaspora.php b/include/diaspora.php
index 104ccadf2e..04238f17ce 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1920,6 +1920,7 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$images = array();
+ $title = $item['title'];
$body = $item['body'];
/*
@@ -1944,9 +1945,12 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
}
}
*/
-
$body = xmlify(html_entity_decode(bb2diaspora($body)));
+ if(strlen($title))
+ $body = xmlify('**' . html_entity_decode($title) . '**' . "\n") . $body;
+
+
if($item['attach']) {
$cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism',$item['attach'],$matches,PREG_SET_ORDER);
if(cnt) {
diff --git a/include/items.php b/include/items.php
index 9f7eb84d96..ee69605349 100755
--- a/include/items.php
+++ b/include/items.php
@@ -416,7 +416,7 @@ function get_atom_elements($feed,$item) {
// the wild, by sanitising it and converting supported tags to bbcode before we rip out any remaining
// html.
- if((strpos($res['body'],'<') !== false) || (strpos($res['body'],'>') !== false)) {
+ if((strpos($res['body'],'<') !== false) && (strpos($res['body'],'>') !== false)) {
$res['body'] = reltoabs($res['body'],$base_url);
@@ -429,13 +429,21 @@ function get_atom_elements($feed,$item) {
// we shouldn't need a whitelist, because the bbcode converter
// will strip out any unsupported tags.
- // $config->set('HTML.Allowed', 'p,b,a[href],i');
$purifier = new HTMLPurifier($config);
$res['body'] = $purifier->purify($res['body']);
- $res['body'] = html2bbcode($res['body']);
+ $res['body'] = @html2bbcode($res['body']);
}
+ elseif(! $have_real_body) {
+
+ // it's not one of our messages and it has no tags
+ // so it's probably just text. We'll escape it just to be safe.
+
+ $res['body'] = escape_tags($res['body']);
+ }
+
+ // this tag is obsolete but we keep it for really old sites
$allow = $item->get_item_tags(NAMESPACE_DFRN,'comment-allow');
if($allow && $allow[0]['data'] == 1)
diff --git a/include/message.php b/include/message.php
index 7ad80ae9c6..377d7c715b 100755
--- a/include/message.php
+++ b/include/message.php
@@ -1,4 +1,5 @@
get_baseurl() . ':' . local_user() . ':' . $hash ;
+
+ $convid = 0;
+ $reply = false;
+
+ require_once('include/Scrape.php');
+
+ $me = probe_url($replyto);
+
+ if(! $me['name'])
+ return -2;
+
+ $conv_guid = get_guid();
+
+ $recip_handle = $recipient['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
+
+ $sender_nick = basename($replyto);
+ $sender_host = substr($replyto,strpos($replyto,'://')+3);
+ $sender_host = substr($sender_host,0,strpos($sender_host,'/'));
+ $sender_handle = $sender_nick . '@' . $sender_host;
+
+ $handles = $recip_handle . ';' . $sender_handle;
+
+ $r = q("insert into conv (uid,guid,creator,created,updated,subject,recips) values(%d, '%s', '%s', '%s', '%s', '%s', '%s') ",
+ intval(local_user()),
+ dbesc($conv_guid),
+ dbesc($sender_handle),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc($subject),
+ dbesc($handles)
+ );
+
+ $r = q("select * from conv where guid = '%s' and uid = %d limit 1",
+ dbesc($conv_guid),
+ intval($recipient['uid'])
+ );
+ if(count($r))
+ $convid = $r[0]['id'];
+
+ if(! $convid) {
+ logger('send message: conversation not found.');
+ return -4;
+ }
+
+ $r = q("INSERT INTO `mail` ( `uid`, `guid`, `convid`, `from-name`, `from-photo`, `from-url`,
+ `contact-id`, `title`, `body`, `seen`, `reply`, `replied`, `uri`, `parent-uri`, `created`, `unknown`)
+ VALUES ( %d, '%s', %d, '%s', '%s', '%s', %d, '%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d )",
+ intval($recipient['uid']),
+ dbesc(get_guid()),
+ intval($convid),
+ dbesc($me['name']),
+ dbesc($me['photo']),
+ dbesc($me['url']),
+ 0,
+ dbesc($subject),
+ dbesc($body),
+ 0,
+ 0,
+ 0,
+ dbesc($uri),
+ dbesc($replyto),
+ datetime_convert(),
+ 1
+ );
+
+ return 0;
+
+}
diff --git a/include/network.php b/include/network.php
index 22157ff188..9e1ed2091d 100755
--- a/include/network.php
+++ b/include/network.php
@@ -364,6 +364,9 @@ function lrdd($uri, $debug = false) {
logger('lrdd: host_meta: ' . $xml, LOGGER_DATA);
+ if(! stristr($xml,'',
'',
'',
+ '',
+ '',
'',
'',
'',
@@ -921,7 +924,7 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= ',';
- $x .= file_tag_decode($mtch[1]);
+ $x .= xmlify(file_tag_decode($mtch[1]));
}
if(strlen($x))
$s .= '