diff --git a/.gitignore b/.gitignore
index 10a7187cf..9b3b23a00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+favicon.*
.htconfig.php
\#*
wip/*
@@ -6,4 +7,5 @@ include/jquery-1.4.2.min.js
*.out
*.version*
push*
+langup
home.html
diff --git a/.htaccess b/.htaccess
index b06dd8bdc..fe09fc522 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,4 +1,3 @@
-
Options -Indexes
AddType application/x-java-archive .jar
AddType audio/ogg .oga
diff --git a/README b/README
index 36bd01792..dc5a176d2 100644
--- a/README
+++ b/README
@@ -1,132 +1,74 @@
- *********
- Friendika
- *********
+ *************
+ * Friendika *
+ *************
- Distributed Social Network
+ Friendika Communications Server
- http://friendika.com
-
-
- Since the dawn of the world-wide-web, the internet has been a battleground
-between the "big boys" with all their resources, and a bunch of upstarts whose
-goal is to topple the status quo - and bring the same powers of global reach
-to anybody with a computer and an internet connection.
-
- The latest battleground is social networking. Many of your friends would
-have you believe that the world (and all the information in it) belongs to
-Facebook.
-
- Friendika is here to rock that boat.
-
- Granted, all your friends aren't here - yet. The people who made fun of you
-in high school (yet curiously wanted to be friends with you now) are still
-"poking" each other and managing their virtual farms and telling you all about
-their virtual gang wars. Would you miss them?
-
- I wouldn't.
-
- You probably have a handful of friends that are truly special. Tell those
-friends that the world has changed - because it has. It's time to move on. A
-year ago, if you had left Facebook, there was no place to go - at least a
-place which offered the same kind of social interaction (and wasn't just
-another huge company trying to make money off of all of your private
-information).
-
- Today you have options.
-
- What if there was a social network which provided some of the same
-interaction you've grown to love, *and* was free to use, *and* was open source,
-*and* where your privacy is always under your control?
-
- And what if this social network could scale to encompass the entire
-internet, and *not* require a central organisation to provide servers?
-(In exchange for peddling your private information behind your back.)
-
- Look no further.
-
- Friendika is a social network without boundaries, and without ownership.
-Friendika installations can link together into a global social network which
-is free from central control. Besides the Friendika network (which is privacy
-enhanced); you can also connect with and communicate with friends on identi.ca,
-Status.Net and many other sites and social networks *today*.
-
- Welcome to the federated social web. If you choose not to use Friendika
-(though we think you'd be foolish not to), you can choose any of 20-30 other
-providers of federated social networking software and still be a part of this
-vast new social network. This is going to be bigger than Facebook.
-
- Much bigger.
-
- We are currently developing connectors to seamlessly communicate with many
-other open social networks and providers - like Diaspora, GNU-Social,
-OneSocialWeb, and even some of the larger closed services such as Facebook and
-Twitter.
-
- Over the coming months, the boundaries between these networks will start
-to become indistinguishable as they all become part of your social circle.
-
- Our core belief is that your personal thoughts and conversations belong to
-you - and are only meant to be shared with those you wish to share them with.
-
- Period.
-
- Friendika is secure, and as private as you wish it to be. Our privacy
-settings are straight-forward and simple, because we know that relationships
-rarely are (straight-forward and simple). Whether you're communicating with
-drinking buddies or potential employers, you can rest assured that each is
-only able to see the side of you that you wish to present. If you send a
-private message to your aunt Mary, we will encrypt it with military grade
-encryption.
-
- Other distributed social network projects talk about privacy and offering
-a feature-rich social networking alternative, but all they can deliver is
-vapour and vague promises. Things like "Private mail will be in the next
-release".
-
- Friendika delivers. We've got an incredibly rich social communications
-interface you can make use of *right now*.
-
- And lest you think we're just trying to copy Facebook feature-for-feature,
-you couldn't be further from the truth. We like the conversational style
-because it feels natural, and that's why Facebook grew to be what it is today.
-But we're creating something completely different.
-
- Something better.
-
- A single instance of Friendika can easily support hundreds of (and up to
-several thousand) people using commodity hosting hardware. You could even run
-Friendika on an old PC in your closet or garage. Each of these people are able
-to connect with potentially hundreds or thousands of friends and associates
-on any other supported network anywhere in the world and share photos, links,
-status updates, etc.
-
- But maybe you don't want to be connected to the world... and that's OK
-too. Friendika may be closed off from the global community and used to support
-social networking amongst corporate, educational, religious, and other private
-communities. This makes it an excellent choice for the social networking needs
-of young teenagers and especially k-12 organisations.
-
- Every person on Friendika has unlimited profiles available to them. There
-is a "public profile" which can be seen by anybody. Additional profiles may be
-tailored to specific groups or individuals. Try doing that on Twitter.
-
- Groups may be created and used for closed conversations. In this way your
-conversations with one group of friends is completely isolated from other
-friends or groups of friends.
-
- You may also create interactive band/celebrity pages, special interest
-groups, and even organisational 'soapboxes' - for social communications that
-require the ability to scale to global levels. Friendika provides for automatic
-relationship management in these extreme cases so that you can concentrate on
-your message and public persona - and not worry about being swamped by friend
-requests. You can even maintain private social contact with your closest
-friends and public updates to your hordes of fans - using the same interface.
-
- No other social network offers this ability.
+ http://project.friendika.com
- Join us.
+ Friendika is a web application for managing social communications. Some
+would call it a "social network" or "distributed social network". We think
+both terms have been over-used, and don't adequately describe Friendika's
+capabilities - though Friendika can also fill those roles.
+
+ At its essence, Friendika is a web application which can monitor various
+information and social activity streams, and which also lets you participate
+in online conversations with friends and associates, using a variety of network
+protocols. These are combined into an overview of your various communications
+and activities - regardless of network origin.
+
+ Friendika also manages your personal profiles and photo albums and lets
+you securely present each of these to specific audiences. Your communications
+can be either open and public, or closed and private. You can easily create
+"groups" of contacts with which you can partition your conversations into
+private social circles, and which cannot be seen outside the circle.
+
+ Friendika is decentralised. Any account on any Friendika server can connect
+with any account on any other Friendika server. You can also connect to and
+interact directly with friends on Status.Net and other federated social web
+services (e.g. identi.ca, GNU-Social, etc.).
+
+ Outgoing communications can be directed at these networks and also
+existing accounts on Facebook and Twitter - or even delivered to email
+contacts.
+
+ Incoming data streams aren't limited to traditional social networks.
+They may include most any service which provides a syndication feed (both RSS
+and Atom). This allows you to view communications from friends in other
+diverse social networks - such as Diaspora, Google Buzz, and millions of
+blogs, news services, and other websites. You can also import
+contacts from (and write to) anybody that is accessible from your email
+INBOX and view them in your social stream. Over time we will try to
+build two-way bridges to other services so that you can freely
+interact in both directions with anybody on an accessible network that
+allows it.
+
+ Communications between Friendika servers are private and encrypted,
+using military grade encryption - and require mutual identity provenance
+before any data is exchanged. These same crypto mechanisms provide remote
+password-less authentication; allowing you to post to profiles and view private
+photo collections on other servers - without encountering any login and/or
+authorisation dialogues when visiting these sites.
+
+ Friendika has no boundaries and no central ownership of the data generated
+within the network. Anybody with a commodity PHP/MySQL web server or hosting
+account can provide a server, and each individual server can then support
+up to several thousand participating members - each with their own unique
+communication and privacy needs. This allows Friendika to scale to global
+levels and mimics the decentralised architecture of the web itself.
+
+ If you are creating a website which requires social interaction, Friendika
+can also take the place of blog software, forum software and feed readers, and
+also provide individualised communications and content management - or
+simply be used as an alternative to traditional "monolithic" social networks.
+
+ Friendika is also free - in every sense of the word.
+
+ Choose freedom - join us.
+
+ Find out more about the project at http://project.friendika.com
*******************
Friendika Demo Site
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index edfc5a374..667b2ce6f 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -1,17 +1,13 @@
config['system']['addon'] = 'plugin1,plugin2,facebook';
- * 3. Visit your site url + '/facebook' (e.g. http://example.com/facebook)
- * and click 'Install Facebook posting'.
+ * 3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
+ * and click 'Install Facebook Connector'.
* 4. This will ask you to login to Facebook and grant permission to the
* plugin to do its stuff. Allow it to do so.
- * 5. You're done. To turn it off visit your site's /facebook page again and
+ * 5. You're done. To turn it off visit the Plugin Settings page again and
* 'Remove Facebook posting'.
*
- * Turn logging on (see the github Friendika wiki page 'Settings') and
- * repeat these steps if you have trouble.
* Vidoes and embeds will not be posted if there is no other content. Links
- * and images will be converted to text and long posts truncated - with a link
- * to view the full post. Posts with permission settings and comments will
- * not be posted to Facebook.
+ * and images will be converted to a format suitable for the Facebook API and
+ * long posts truncated - with a link to view the full post.
*
+ * Facebook contacts will not be able to view private photos, as they are not able to
+ * authenticate to your site to establish identity. We will address this
+ * in a future release.
*/
define('FACEBOOK_MAXPOSTLEN', 420);
@@ -88,6 +84,10 @@ function facebook_init(&$a) {
$token = substr($token,0,strpos($token,'&'));
set_pconfig($uid,'facebook','access_token',$token);
set_pconfig($uid,'facebook','post','1');
+ fb_get_self($uid);
+ fb_get_friends($uid);
+ fb_consume_all($uid);
+
}
// todo: is this a browser session or a server session? where do we go?
@@ -95,6 +95,138 @@ function facebook_init(&$a) {
}
+
+function fb_get_self($uid) {
+ $access_token = get_pconfig($uid,'facebook','access_token');
+ if(! $access_token)
+ return;
+ $s = fetch_url('https://graph.facebook.com/me/?access_token=' . $access_token);
+ if($s) {
+ $j = json_decode($s);
+ set_pconfig($uid,'facebook','self_id',(string) $j->id);
+ }
+}
+
+
+
+function fb_get_friends($uid) {
+
+ $access_token = get_pconfig($uid,'facebook','access_token');
+ if(! $access_token)
+ return;
+ $s = fetch_url('https://graph.facebook.com/me/friends?access_token=' . $access_token);
+ if($s) {
+ logger('facebook: fb_get_friends: ' . $s, LOGGER_DATA);
+ $j = json_decode($s);
+ logger('facebook: fb_get_friends: json: ' . print_r($j,true), LOGGER_DATA);
+ foreach($j->data as $person) {
+ $s = fetch_url('https://graph.facebook.com/' . $person->id . '?access_token=' . $access_token);
+ if($s) {
+ $jp = json_decode($s);
+ logger('fb_get_friends: info: ' . print_r($jp,true), LOGGER_DATA);
+
+ // always use numeric link for consistency
+
+ $jp->link = 'http://facebook.com/profile.php?id=' . $person->id;
+
+ // check if we already have a contact
+
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
+ intval($uid),
+ dbesc($jp->link)
+ );
+
+ if(count($r)) {
+
+ // check that we have all the photos, this has been known to fail on occasion
+
+ if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro'])) {
+ require_once("Photo.php");
+
+ $photos = import_profile_photo('https://graph.facebook.com/' . $jp->id . '/picture', $uid, $r[0]['id']);
+
+ $r = q("UPDATE `contact` SET `photo` = '%s',
+ `thumb` = '%s',
+ `micro` = '%s',
+ `name-date` = '%s',
+ `uri-date` = '%s',
+ `avatar-date` = '%s'
+ WHERE `id` = %d LIMIT 1
+ ",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval($r[0]['id'])
+ );
+ }
+ continue;
+ }
+ else {
+
+ // create contact record
+ $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `addr`, `alias`, `notify`, `poll`,
+ `name`, `nick`, `photo`, `network`, `rel`, `priority`,
+ `writable`, `blocked`, `readonly`, `pending` )
+ VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0 ) ",
+ intval($uid),
+ dbesc(datetime_convert()),
+ dbesc($jp->link),
+ dbesc(''),
+ dbesc(''),
+ dbesc($jp->id),
+ dbesc('facebook ' . $jp->id),
+ dbesc($jp->name),
+ dbesc(($jp->nickname) ? $jp->nickname : strtolower($jp->first_name)),
+ dbesc('https://graph.facebook.com/' . $jp->id . '/picture'),
+ dbesc(NETWORK_FACEBOOK),
+ intval(REL_BUD),
+ intval(1),
+ intval(1)
+ );
+ }
+
+ $r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($jp->link),
+ intval($uid)
+ );
+
+ if(! count($r)) {
+ continue;
+ }
+
+ $contact = $r[0];
+ $contact_id = $r[0]['id'];
+
+ require_once("Photo.php");
+
+ $photos = import_profile_photo($r[0]['photo'],$uid,$contact_id);
+
+ $r = q("UPDATE `contact` SET `photo` = '%s',
+ `thumb` = '%s',
+ `micro` = '%s',
+ `name-date` = '%s',
+ `uri-date` = '%s',
+ `avatar-date` = '%s'
+ WHERE `id` = %d LIMIT 1
+ ",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval($contact_id)
+ );
+
+ }
+ }
+ }
+}
+
+
function facebook_post(&$a) {
if(local_user()){
@@ -116,6 +248,12 @@ function facebook_content(&$a) {
notice( t('Facebook disabled') . EOL);
}
+ if($a->argc > 1 && $a->argv[1] === 'friends') {
+ fb_get_friends(local_user());
+ notice( t('Updating contacts') . EOL);
+ }
+
+
$fb_installed = get_pconfig(local_user(),'facebook','post');
$appid = get_config('facebook','appid');
@@ -134,14 +272,14 @@ function facebook_content(&$a) {
$o .= '
';
+ return $o;
+}}
+
+
+if(! function_exists('parse_xml_string')) {
+function parse_xml_string($s) {
+ if(! strstr($s,'code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
+ libxml_clear_errors();
+ return $x;
+}}
+
+if(! function_exists('is_site_admin')) {
+function is_site_admin() {
+ $a = get_app();
+ if(local_user() && x($a->user,'email') && x($a->config,'admin_email') && ($a->user['email'] === $a->config['admin_email']))
+ return true;
+ return false;
}}
\ No newline at end of file
diff --git a/database.sql b/database.sql
index f47a5967e..c15a9ad9c 100644
--- a/database.sql
+++ b/database.sql
@@ -64,6 +64,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`issued-id` char(255) NOT NULL,
`dfrn-id` char(255) NOT NULL,
`url` char(255) NOT NULL,
+ `addr` char(255) NOT NULL,
`alias` char(255) NOT NULL,
`pubkey` text NOT NULL,
`prvkey` text NOT NULL,
@@ -85,6 +86,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`priority` tinyint(3) NOT NULL,
`blocked` tinyint(1) NOT NULL DEFAULT '1',
`readonly` tinyint(1) NOT NULL DEFAULT '0',
+ `writable` tinyint(1) NOT NULL DEFAULT '0',
`pending` tinyint(1) NOT NULL DEFAULT '1',
`rating` tinyint(1) NOT NULL DEFAULT '0',
`reason` text NOT NULL,
@@ -164,6 +166,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`gravity` tinyint(1) NOT NULL DEFAULT '0',
`parent` int(10) unsigned NOT NULL DEFAULT '0',
`parent-uri` char(255) NOT NULL,
+ `extid` char(255) NOT NULL,
`thr-parent` char(255) NOT NULL,
`created` datetime NOT NULL,
`edited` datetime NOT NULL,
@@ -184,6 +187,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`plink` char(255) NOT NULL,
`resource-id` char(255) NOT NULL,
`tag` mediumtext NOT NULL,
+ `attach` mediumtext NOT NULL,
`inform` mediumtext NOT NULL,
`location` char(255) NOT NULL,
`coord` char(255) NOT NULL,
@@ -192,6 +196,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`deny_cid` mediumtext NOT NULL,
`deny_gid` mediumtext NOT NULL,
`private` tinyint(1) NOT NULL DEFAULT '0',
+ `pubmail` tinyint(1) NOT NULL DEFAULT '0',
`visible` tinyint(1) NOT NULL DEFAULT '0',
`unseen` tinyint(1) NOT NULL DEFAULT '1',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
@@ -204,6 +209,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `wall` (`wall`),
KEY `parent` (`parent`),
KEY `parent-uri` (`parent-uri`),
+ KEY `extid` (`extid`),
KEY `created` (`created`),
KEY `edited` (`edited`),
KEY `visible` (`visible`),
@@ -297,7 +303,8 @@ CREATE TABLE IF NOT EXISTS `profile` (
`sexual` char(255) NOT NULL,
`politic` char(255) NOT NULL,
`religion` char(255) NOT NULL,
- `keywords` text NOT NULL,
+ `pub_keywords` text NOT NULL,
+ `prv_keywords` text NOT NULL,
`about` text NOT NULL,
`summary` char(255) NOT NULL,
`music` text NOT NULL,
@@ -314,7 +321,9 @@ CREATE TABLE IF NOT EXISTS `profile` (
`thumb` char(255) NOT NULL,
`publish` tinyint(1) NOT NULL DEFAULT '0',
`net-publish` tinyint(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
+ PRIMARY KEY (`id`),
+ FULLTEXT KEY `pub_keywords` (`pub_keywords`),
+ FULLTEXT KEY `prv_keywords` (`prv_keywords`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
@@ -363,6 +372,7 @@ CREATE TABLE IF NOT EXISTS `user` (
`email` char(255) NOT NULL,
`openid` char(255) NOT NULL,
`timezone` char(128) NOT NULL,
+ `language` char(32) NOT NULL DEFAULT 'en',
`register_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`login_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`default-location` char(255) NOT NULL,
@@ -374,10 +384,12 @@ CREATE TABLE IF NOT EXISTS `user` (
`sprvkey` text NOT NULL,
`verified` tinyint(1) unsigned NOT NULL DEFAULT '0',
`blocked` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ `blockwall` tinyint(1) unsigned NOT NULL DEFAULT '0',
`notify-flags` int(11) unsigned NOT NULL DEFAULT '65535',
`page-flags` int(11) unsigned NOT NULL DEFAULT '0',
`pwdreset` char(255) NOT NULL,
`maxreq` int(11) NOT NULL DEFAULT '10',
+ `expire` int(11) unsigned NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -479,3 +491,48 @@ CREATE TABLE IF NOT EXISTS `cache` (
`v` TEXT NOT NULL,
`updated` DATETIME NOT NULL
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE IF NOT EXISTS `fcontact` (
+`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`url` CHAR( 255 ) NOT NULL ,
+`name` CHAR( 255 ) NOT NULL ,
+`photo` CHAR( 255 ) NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `ffinder` (
+`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`uid` INT UNSIGNED NOT NULL ,
+`cid` INT UNSIGNED NOT NULL ,
+`fid` INT UNSIGNED NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE IF NOT EXISTS `mailacct` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`uid` INT NOT NULL,
+`server` CHAR( 255 ) NOT NULL ,
+`port` INT NOT NULL,
+`ssltype` CHAR( 16 ) NOT NULL,
+`mailbox` CHAR( 255 ) NOT NULL,
+`user` CHAR( 255 ) NOT NULL ,
+`pass` TEXT NOT NULL ,
+`reply_to` CHAR( 255 ) NOT NULL ,
+`pubmail` TINYINT(1) NOT NULL DEFAULT '0',
+`last_check` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `attach` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`uid` INT NOT NULL ,
+`filetype` CHAR( 64 ) NOT NULL ,
+`filesize` INT NOT NULL ,
+`data` LONGBLOB NOT NULL ,
+`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+`edited` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+`allow_cid` MEDIUMTEXT NOT NULL ,
+`allow_gid` MEDIUMTEXT NOT NULL ,
+`deny_cid` MEDIUMTEXT NOT NULL ,
+`deny_gid` MEDIUMTEXT NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
diff --git a/doc/Account-Basics.md b/doc/Account-Basics.md
new file mode 100644
index 000000000..9c6548430
--- /dev/null
+++ b/doc/Account-Basics.md
@@ -0,0 +1,66 @@
+Account Basics
+==============
+
+* [Home](help)
+
+
+**Registration**
+
+Not all Friendika sites allow open registration. If registration is allowed, you will see a "Register" link immediately below the login prompts on the site home page. Following this link will take you to the site Registration page.
+
+*OpenID*
+
+The first field on the Registration page is for an OpenID address. If you do not have an OpenID address or do not wish to use OpenID, leave this field blank. If you have an OpenID account elsewhere and wish to use it, enter the address into this field and click 'Register'. Friendika will attempt to extract as much information as possible from your OpenID provider and return to this page with those items already filled in.
+
+*Your Full Name*
+
+Please provide your full name as you would like it to be displayed on this system.
+
+*Email Address*
+
+Please provide a valid email address. Your email address is **never** published. We need this to send you account information and your login details. You may also occasionally receive notifications of incoming messages or items requiring your attention, but you have the ability to completely disable these once from your Settings page once you have logged in.
+
+*Nickname*
+
+A nickname is used to generate web addresses for many of your personal pages, and is also treated like an email address when establishing communications with others. Due to the way that the nickname is used, it has some limitations. It must contain only US-ASCII text characters and numbers, and must also start with a text character. It also must be unique on this system. This is used in many places to identify your account, and once set - cannot be changed.
+
+
+
+*Directory Publishing*
+
+The Registration form also allows you to choose whether or not to list your account in the online directory. This is like a "phone book" and you may choose to be unlisted. We recommend that you select 'Yes' so that other people (friends, family, etc.) will be able to find you. If you choose 'No', you will essentially be invisible and have few opportunities for interaction. Whichever you choose, this can be changed any time from your Settings page after you login.
+
+
+*Register*
+
+Once you have provided the necessary details, click the 'Register' button. An email will be sent to you providing your account login details. Some sites may require administrator approval before the registration is processed, and you will be alerted if this is the case. Please watch your email (including spam folders) for your registration approval.
+
+
+
+
+**Login Page**
+
+On the 'Login' page, please enter your login information that was provided during registration. You may use either your nickname or email address as a Login Name.
+
+If you use your account to manage multiple '[Pages](help/Pages)' and these all have the same email address, please enter the nickname for the account you wish to manage.
+
+*If* your account has been OpenID enabled, you may use your OpenID address as a login name and leave the password blank. You will be redirected to your OpenID provider to complete your authorisation.
+
+Otherwise, enter your password. This will have been initially provided in your registration email message. Your password is case-sensitive, so please check your 'Caps Lock' key if you are having difficulty logging in.
+
+
+**Changing Your Password**
+
+After your first login, please visit the 'Settings' page from the top menu bar and change your password to something that you will remember.
+
+
+
+**See Also**
+
+* [Profiles](help/Profiles)
+
+* [Groups and Privacy](help/Groups-and-Privacy)
+
+* [Remove Account](help/Remove-Account)
+
+
\ No newline at end of file
diff --git a/doc/Bugs-and-Issues.md b/doc/Bugs-and-Issues.md
new file mode 100644
index 000000000..ed2be00c8
--- /dev/null
+++ b/doc/Bugs-and-Issues.md
@@ -0,0 +1,30 @@
+Bugs and Issues
+===============
+
+* [Home](help)
+
+
+Please report any bugs/issues you encounter using our bug tracker at [[http://bugs.friendika.com]]
+
+Try to provide as much information as you can about the bug (including the full text of any error messages or notices), and if possible your Friendika version.
+
+Your Friendika version may be found in newer releases by visiting http://YOURFRIENDIKASITE/friendika
+
+For older versions, view the HTML source of your profile page. The Friendika version is in the HTML header, 5-10 lines from the top of the page.
+
+For really old versions which don't have a version number in the HTML header - please upgrade. Your bug was probably fixed a long time ago.
+
+**Bug Sponsorship**
+
+The bug/issue database allows you to sponsor issues. This provides an incentive for developers to work on your issue. This isn't necessary - we don't like bugs and will try to fix them. This has more importance for future development projects and feature requests.
+
+Bug sponsorship works on the honour system. If you agree to pay $10 to fix a bug, when the fix has been checked in and verified you should send a paypal payment to the developer assigned to the bug. Don't ever think you can get away with not paying a developer for work performed. Some of these guys could hack into your credit card account if you make them mad.
+
+At the present time, one has to be approved as a "developer" to be able to assign themselves to a sponsored bug. This requires the developer to have some history fixing Friendika bugs. This is for everybody's assurance that the bug fix will work well with Friendika. If you wish to become approved as a developer, work on and check in some non-sponsored issues or your own projects and we will move you up the ladder.
+
+If you truly feel you have the solution to a sponsored bug but aren't an approved developer, you risk a sponsored developer assigning the bug to themselves before you check it in, but if they haven't done so - include a short note with your pull request. Assuming that it meets our code standards, we'll see that you get credit.
+
+If you sponsor a project at greater than a $50 level, you may be requested by the developer for payment up front before work has begun (typically half). Again this is on the honour system - and is mostly to avoid payment issues and disagreements later. You should also expect to see some progress updates or demonstrations if the work takes more than a week or two. If the work is not completed within a reasonable time (as decided by those involved), you are entitled to get your money back.
+
+Friendika is not involved in these transactions. It is purely a personal agreement between sponsors and developers. If there are any issues, the parties will need to work it out between themselves. We're just providing some guidelines to help avoid potential problems.
+
diff --git a/doc/Connectors.md b/doc/Connectors.md
new file mode 100644
index 000000000..45bce8d9a
--- /dev/null
+++ b/doc/Connectors.md
@@ -0,0 +1,63 @@
+Connectors
+==========
+
+* [Home](help)
+
+Connectors allow you to connect with external social networks and services. Connectors are only required for posting to existing accounts on Facebook, Twitter, and StatusNet. There is also a connector for accessing your email INBOX.
+
+If the following network connectors are installed on your system, select the following links to visit the appropriate settings page and configure them for your account:
+
+* [Facebook](/settings/addon)
+* [Twitter](/settings/addon)
+* [StatusNet](/settings/addon)
+* [Email](/settings)
+
+Instructions For Connecting To People On Specific Services
+==========================================================
+
+**Friendika**
+
+
+You may connect by providing your Identity Address on the 'Connect' page of any Friendika member. You may also put their Identity Address into the Connect box on your [Contacts](contacts) page.
+
+**Identi.ca/StatusNet/GNU-Social**
+
+These are described as the "federated social web" or OStatus contacts.
+
+Please note that there are **no** privacy provisions on the OStatus network. Any message which is delivered to **any** OStatus member is visible to anybody in the world and will negate any privacy settings that you have in effect. These messages will also turn up in public searches.
+
+To connect with an OStatus member insert their profile URL or Identity address into the Connect box on your [Contacts](contacts) page.
+
+The StatusNet connector may be used if you wish posts to appear on an OStatus site using an existing OStatus account.
+
+It is not necessary to do this, as you may 'follow' OStatus members from Friendika and they may follow you (by placing their own Identity Address into your 'Connect' page).
+
+**Blogger, Wordpress, RSS feeds, arbitrary web pages**
+
+Put the URL into the Connect box on your [Contacts](contacts) page. You will not be able to reply to these contacts.
+
+This will allow you to _connect_ with millions of pages on the internet. All that we require to do this is that the page use a discoverable feed using either the RSS or Atom syndication format, and which provides an author name and a site image in a form which we can extract.
+
+
+**Twitter**
+
+To follow a Twitter member, put the URL of the Twitter member's main page into the Connect box on your [Contacts](contacts) page. To reply, you must have the Twitter connector installed, and reply using your own status editor. Begin the message with @twitterperson replacing with the Twitter username.
+
+**Diaspora**
+
+To follow a Diaspora member, put either the URL or the pod address (Identity Address) of the Diaspora member into the Connect box on your [Contacts](contacts) page. It is not currently possible to reply to Diaspora members. This will be provided in a future release (once the Diaspora communication protocols stabilise and are published).
+
+**Email**
+
+Configure the email connector from your [Settings](settings) page. Once this has been done, you may enter an email addres to connect with using the Connect box on your [Contacts](contacts) page. They must be the sender of a message which is currently in your INBOX for the connect to succeed. You may include email contacts in private conversations.
+
+**Facebook**
+
+The Facebook connector is a plugin/addon which allows you to interact with friends on Facebook from within Friendika. If enabled, your Facebook friend list will be imported, and you will see and be able to respond to Facebook posts. Facebook members may also be added to private conversation groups. You will not be able to connect with individual Facebook accounts - but will have your entire friend list imported and updated if new friends are added.
+
+Assuming the Facebook plugin/addon has been installed on your system, it can be enabled by going to your [Plugin Settings](settings/addon) page, and then select "Facebook Connector Settings" on that page. This will only appear if the Facebook plugin/addon has been installed. Follow the instruction to install or remove the Facebook connector.
+
+You may also choose whether your public postings are posted to Facebook by default. You may toggle this setting at any time from the Permissions settings of the status post editor (click the lock icon). This setting has no effect on private conversations - which will always be delivered to Facebook friends who are included in the permissions.
+
+(Note: At this time, Facebook contacts will not be able to view any private photos. This will be resolved in a future release. Facebook contacts may however see any public photos you have uploaded.)
+
diff --git a/doc/Developers.md b/doc/Developers.md
new file mode 100644
index 000000000..ebfaf97c3
--- /dev/null
+++ b/doc/Developers.md
@@ -0,0 +1,22 @@
+Friendika Developer Guide
+
+Here is how you can join us.
+
+First, get yourself a working git package on the system where you will be
+doing development.
+
+Create your own github account.
+
+You may fork/clone the Friendika repository from [https://github.com/friendika/friendika.git](https://github.com/friendika/friendika.git).
+
+Follow the instructions provided here: [http://help.github.com/fork-a-repo/](http://help.github.com/fork-a-repo/)
+to create and use your own tracking fork on github
+
+Then go to your github page and create a "Pull request" when you are ready
+to notify us to merge your work.
+
+**Important**
+
+Please pull in any changes from the project repository and merge them with your work **before** issuing a pull request. We reserve the right to reject any patch which results in a large number of merge conflicts. This is especially true in the case of language translations - where we may not be able to understand the subtle differences between conflicting versions.
+
+Also - **test your changes**. Don't assume that a simple fix won't break something else. If possible get an experienced Friendika developer to review the code.
\ No newline at end of file
diff --git a/doc/Groups-and-Privacy.md b/doc/Groups-and-Privacy.md
new file mode 100644
index 000000000..7ff76906f
--- /dev/null
+++ b/doc/Groups-and-Privacy.md
@@ -0,0 +1,36 @@
+Groups and Privacy
+==================
+
+* [Home](help)
+
+
+Groups are merely collections of friends. But Friendika uses these to unlock some very powerful features.
+
+To create a group, visit your Friendika "Contacts" page and select "Create a new group". Give the group a name.
+
+This brings you to a page where you can select the group members.
+
+You will have two boxes on this page. The top box is the roster of current group members. Below that is another box containing all of your friends who are *not* members of the group.
+
+If you click on a photo of a person who isn't in the group, they will be put into the group. If you click on a photo of a person who is in the group, they will be removed from it.
+
+Once you have created a group, you may use it in any access control list. This is the little lock icon beneath the status update box on your home page. If you click this you can select who can see and who can *not* see the post you are about to make. These can be individual people or groups.
+
+On your "Network" page you will find posts and conversation from everybody in your network. You may select an individual group on this page to show conversations pertaining only to members of that group.
+
+But wait, there's more...
+
+If you look carefully when visiting a group from your Network page, the lock icon under the status update box has an exclamation mark next to it. This is meant to draw attention to that lock. Click the lock. You will see that since you are only viewing a certain group of people, your status updates while on that screen default to only being seen by that same group of people. This is how you keep your future employers from seeing what you write to your drinking buddies. You can over-ride this setting, but this makes it easy to separate your conversations into different friend circles.
+
+These private conversations work best when your friends are Freindika members. We know who else can see the conversations - nobody, *unless* your friends cut and paste the messages and send them to others.
+
+This is a trust issue you need to be aware of. No software in the world can prevent your friends from leaking your confidential and trusted communications. Only a wise choice of friends.
+
+But it isn't as clear cut when dealing with status.net, identi.ca and other network providers. You are encouraged to be **very** cautious when other network members are in a group because it's entirely possible for your private messages to end up in a public newsfeed. If you look at the Contact Edit page for any person, we will tell you whether or not they are members of an insecure network where you should exercise caution.
+
+On your "Settings" page, you may create a set of default permissions which apply to every post that you create.
+
+Once you have created a post, you can not change the permissions assigned. Within seconds it has been delivered to lots of people - and perhaps everybody it was addressed to. If you mistakenly created a message and wish you could take it back, the best you can do is to delete it. We will send out a delete notification to everybody who received the message - and this should wipe out the message with the same speed it was initially propagated. In most cases it will be completely wiped from the Internet - in under a minute. Again, this applies to Friendika networks. Once a message spreads to other networks, it may not be removed quickly and in some cases it may not be removed at all.
+
+In case you haven't yet figured this out, we are encouraging you to encourage your friends to use Friendika - because all these privacy features work much better within a privacy-aware network. Many of the other social networks Friendika can connect to have no privacy controls.
+
diff --git a/doc/Home.md b/doc/Home.md
new file mode 100644
index 000000000..f91895620
--- /dev/null
+++ b/doc/Home.md
@@ -0,0 +1,36 @@
+Friendika Documentation and Resources
+=====================================
+
+
+**Contents**
+
+* [Account Basics](help/Account-Basics)
+* [Profiles](help/Profiles)
+* [Connectors](help/Connectors)
+* [Making Friends](help/Making-Friends)
+* [Groups and Privacy](help/Groups-and-Privacy)
+* [Tags and Mentions](help/Tags-and-Mentions)
+* [Pages](help/Pages)
+* [Remove Account](help/Remove-Account)
+* [Bugs and Issues](help/Bugs-and-Issues)
+
+**Technical Documentation**
+
+* [Install](help/Install)
+* [Settings](help/Settings)
+* [Plugins](help/Plugins)
+* [Installing Connectors (Facebook/Twitter/StatusNet)](help/Installing-Connectors)
+* [Message Flow](help/Message-Flow)
+* [Developers](help/Developers)
+
+
+**External Resources**
+
+* [Main Website](http://friendika.com)
+* [Forums](http://groups.google.com/group/friendika)
+* [Developer Forums](http://groups.google.com/group/friendika-dev)
+
+**About**
+
+* [Site/Version Info](friendika)
+
diff --git a/doc/Install.md b/doc/Install.md
new file mode 100644
index 000000000..3538d7bfa
--- /dev/null
+++ b/doc/Install.md
@@ -0,0 +1,97 @@
+Friendika Installation
+
+We've tried very hard to ensure that Friendika will run on commodity hosting platforms - such as those used to host Wordpress blogs and Drupal websites. But be aware that Friendika is more than a simple web application. It is a complex communications system which more closely resembles an email server than a web server. For reliability and performance, messages are delivered in the background and are queued for later delivery when sites are down. This kind of functionality requires a bit more of the host system than the typical blog. Not every PHP/MySQL hosting provider will be able to support Friendika. Many will. But **please** review the requirements and confirm these with your hosting provider prior to installation.
+
+Also if you encounter installation issues, please let us know via the forums at http://groups.google.com/group/friendika or file an issue at http://bugs.friendika.com . Please be as clear as you can about your operating environment and provide as much detail as possible about any error messages you may see, so that we can prevent it from happening in the future. Due to the large variety of operating systems and PHP platforms in existence we may have only limited ability to debug your PHP installation or acquire any missing modules - but we will do our best to solve any general code issues.
+
+Before you begin: Choose a domain name or subdomain name for your server. Put some thought into this - because changing it after installation is currently not-supported. Things will break, and some of your friends may have difficulty communicating with you. We plan to address this limitation in a future release.
+
+
+1. Requirements
+ - Apache with mod-rewrite enabled and "Options All" so you can use a
+local .htaccess file
+
+ - PHP 5.2+. The later the better. You'll need 5.3 for encryption of key exchange conversations. On a Windows environment, 5.2+ might not work as the function dns_get_record() is only available with version 5.3.
+ - PHP *command line* access with register_argc_argv set to true in the
+php.ini file
+ - curl, gd, mysql, and openssl extensions
+ - some form of email server or email gateway such that PHP mail() works
+ - mcrypt (optional; used for server-to-server message encryption)
+
+ - Mysql 5.x
+
+ - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks
+(Windows) [Note: other options are presented in Section 7 of this document]
+
+ - Installation into a top-level domain or sub-domain (without a
+directory/path component in the URL) is preferred. Directory paths will
+not be as convenient to use and have not been thoroughly tested.
+
+
+ [Dreamhost.com offers all of the necessary hosting features at a
+reasonable price. If your hosting provider doesn't allow Unix shell access,
+you might have trouble getting everything to work.]
+
+2. Unpack the Friendika files into the root of your web server document area.
+
+ - If you are able to do so, we recommend using git to clone the source repository rather than to use a packaged tar or zip file. This makes the software much easier to update. The Linux command to clone the repository into a directory "mywebsite" would be
+
+ `git clone http://github.com/friendika/friendika.git mywebsite`
+
+ and then you can pick up the latest changes at any time with
+
+ `git pull`
+
+
+
+ - If you copy the directory tree to your webserver, make sure
+ that you also copy .htaccess - as "dot" files are often hidden
+ and aren't normally copied.
+
+
+3. Create an empty database and note the access details (hostname, username, password, database name).
+
+4. Visit your website with a web browser and follow the instructions. Please note any error messages and correct these before continuing.
+
+5. *If* the automated installation fails for any reason, check the following:
+
+ - ".htconfig.php" exists ... If not, edit htconfig.php and change system settings. Rename
+to .htconfig.php
+ - Database is populated. ... If not, import the contents of "database.sql" with phpmyadmin
+or mysql command line
+
+6. At this point visit your website again, and register your personal account.
+Registration errors should all be recoverable automatically.
+If you get any *critical* failure at this point, it generally indicates the
+database was not installed correctly. You might wish to move/rename
+.htconfig.php to another name and empty (called 'dropping') the database
+tables, so that you can start fresh.
+
+7. Set up a cron job or scheduled task to run the poller once every 5-10
+minutes in order to perform background processing. Example:
+
+ `cd /base/directory; /path/to/php include/poller.php`
+
+Change "/base/directory", and "/path/to/php" as appropriate for your situation.
+
+If you are using a Linux server, run "crontab -e" and add a line like the
+one shown, substituting for your unique paths and settings:
+
+`*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php include/poller.php`
+
+You can generally find the location of PHP by executing "which php". If you
+have troubles with this section please contact your hosting provider for
+assistance. Friendika will not work correctly if you cannot perform this step.
+
+Alternative: You may be able to use the 'poormancron' plugin to perform this step
+if you are using a recent Friendika release. To do this, edit the file ".htconfig.php"
+and look for a line describing your plugins. On a fresh installation, it will look like
+
+`$a->config['system']['addon'] = 'js_upload';`
+
+This indicates the "js_upload" addon module is enabled. You may add additional
+addons/plugins using this same line in the configuration file. Change it to read
+
+`$a->config['system']['addon'] = 'js_upload,poormancron';`
+
+and save your changes.
diff --git a/doc/Installing-Connectors.md b/doc/Installing-Connectors.md
new file mode 100644
index 000000000..e43f17fe3
--- /dev/null
+++ b/doc/Installing-Connectors.md
@@ -0,0 +1,154 @@
+Installing Connectors (Facebook/Twitter/StatusNet)
+==================================================
+
+* [Home](help)
+
+
+Friendika uses plugins to provide connectivity to some networks, such as Facebook and Twitter.
+
+There is also a plugin to post through to an existing account on a Status.Net service. You do not require this to communicate with Status.Net members from Friendika - only if you wish to post to an existing account.
+
+All three of these plugins require an account on the target network. In addition you (or typically the server administrator) will need to obtain an API key to provide authenticated access to your Friendika server.
+
+**Site Configuration**
+
+Plugins must be installed by the site administrator before they can be use. This is accomplished through the site
+configuration file ".htconfig.php".
+
+The configuration directive looks like:
+
+```
+$a->config['system']['addon'] = ' ... list of plugins separated by commas ... ';
+```
+
+Example:
+To install all of the connector addons in addition to the default Javascript photo uploader this line would look like:
+
+```
+$a->config['system']['addon'] = 'js_upload,facebook,twitter,statusnet';
+```
+
+You may also add other plugins/addons as your needs require.
+
+
+Each of the connectors also requires an "API key" from the service you wish to connect with. This is also installed in the
+configuration file. The method for obtaining these keys varies greatly - but almost always requires an existing account on the target service. Once installed, these API keys can usually be shared by all site members.
+
+
+The details of configuring each service follows (much of this information comes directly from the plugin source files):
+
+**Twitter Plugin for Friendika**
+
+* Author: Tobias Diekershoff
+* tobias.diekershoff@gmx.net
+
+* License:3-clause BSD license (same as Friendika)
+
+Configuration:
+To use this plugin you need a OAuth Consumer key pair (key & secret)
+you can get it from Twitter at https://twitter.com/apps
+
+Register your Friendika site as "Client" application with "Read & Write" access.
+We do not need "Twitter as login". When you've registered the app you get the
+OAuth Consumer key and secret pair for your application/site.
+
+Add this key pair to your global .htconfig.php
+
+```
+$a->config['twitter']['consumerkey'] = 'your consumer_key here';
+$a->config['twitter']['consumersecret'] = 'your consumer_secret here';
+```
+
+After this, your user can configure their Twitter account settings
+from "Settings -> Plugin Settings".
+
+Documentation: http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/Twitter_Plugin
+
+
+**StatusNet Plugin for Friendika**
+
+* Author: Tobias Diekershoff
+* tobias.diekershoff@gmx.net
+
+* License:3-clause BSD license (same as Friendika)
+
+Configuration
+
+When the addon is activated the user has to aquire the following in order to connect to the StatusNet account of choice.
+
+* The base URL for the StatusNet API, for identi.ca this is https://identi.ca/api/
+* OAuth Consumer key & secret
+
+To get the OAuth Consumer key pair the user has to
+
+(a) ask her Friendika admin if a pair already exists or
+(b) has to register the Friendika server as a client application on the StatusNet server.
+
+This can be done from the account settings under "Settings -> Connections -> Register an OAuth client application -> Register new application".
+
+During the registration of the OAuth client remember the following:
+
+* Application names must be unique on the StatusNet site, so we recommend a Name of 'friendika-nnnn', replace 'nnnn' with a random number or your website name.
+* there is no callback url
+* register a desktop client
+* with read & write access
+* the Source URL should be the URL of your Friendika server
+
+After the required credentials for the application are stored in the configuration you have to actually connect your Friendika account with StatusNet. This is done from the Settings -> Plugin Settings page. Follow the Sign in with StatusNet button, allow access and then copy the security code into the box provided. Friendika will then try to acquire the final OAuth credentials from the API.
+
+If successful the addon settings will allow you to select to post your public messages to your StatusNet account (have a look behind the little lock symbol beneath the status "editor" on your Home or Network pages).
+
+Documentation: http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/StatusNet_Plugin
+
+
+
+**Installing the Friendika/Facebook connector**
+
+* register an API key for your site from developer.facebook.com
+
+This requires a Facebook account, and may require additional authentication in the form of credit card or mobile phone verification.
+
+a. We'd be very happy if you include "Friendika" in the application name
+to increase name recognition. The Friendika icons are also present
+in the images directory and may be uploaded as a Facebook app icon.
+Use images/friendika-16.jpg for the Icon and images/friendika-128.jpg for the Logo.
+
+b. The url should be your site URL with a trailing slash.
+You may use http://portal.friendika.com/privacy as the privacy policy
+URL unless your site has different requirements, and
+http://portal.friendika.com as the Terms of Service URL unless
+you have different requirements. (Friendika is a software application
+and does not require Terms of Service, though your installation of it might).
+
+c. Set the following values in your .htconfig.php file
+
+```
+$a->config['facebook']['appid'] = 'xxxxxxxxxxx';
+$a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx';
+```
+
+Replace with the settings Facebook gives you.
+
+Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
+and click 'Install Facebook Connector'.
+
+This will ask you to login to Facebook and grant permission to the
+plugin to do its stuff. Allow it to do so.
+
+You're done. To turn it off visit the Plugin Settings page again and
+'Remove Facebook posting'.
+
+Videos and embeds will not be posted if there is no other content. Links
+and images will be converted to a format suitable for the Facebook API and
+long posts truncated - with a link to view the full post.
+
+Facebook contacts will also not be able to view "private" photos, as they are not able to
+authenticate to your site to establish identity. We will address this
+in a future release.
+
+
+
+
+
+
+
diff --git a/doc/Making-Friends.md b/doc/Making-Friends.md
new file mode 100644
index 000000000..4bb05872e
--- /dev/null
+++ b/doc/Making-Friends.md
@@ -0,0 +1,50 @@
+Making Friends
+==============
+
+* [Home](help)
+
+Friendship in Friendika can take on a great many different meanings. But let's keep it simple, you want to be friends with somebody. How do you do it?
+
+The first thing you can do is look at the Directory for somebody you would like to connect with. Visit their profile. Just beneath their profile picture will be the word 'Connect' (we're assuming this is an English language profile).
+
+Click that. It will take you to a "Connect" form.
+
+This is going to ask you for your Identity Address. This is necessary so that this person's website can find yours.
+
+What do you put in the box?
+
+If your Friendika site is called "demo.friendika.com" and your username/nickname on that site is "bob", you would put in "bob@demo.friendika.com".
+
+Notice this looks just like an email address. It was meant to be that way. It's easy for people to remember.
+
+You *could* also put in the URL of your "home" page, such as "http://demo.friendika.com/profile/bob", but the email-style address is certainly easier.
+
+When you've submitted the connection page, it will take you back to your own site where you must then login (if necessary) and verify the connection request on *your* site. Once you've done this, the two websites can communicate with each other to complete the process (after your new friend has approved the request).
+
+If you already know somebody's Identity Address, you can enter it in the "connect" box on your "Contacts" page. This will take you through a similar process.
+
+**Alternate Networks**
+
+You can also use your Identity Address or other people's Identity Addresses to become friends across networks. The list of possible networks is growing all the time. If you know (for instance) "bob" on identi.ca (a Status.Net site) you could put bob@identi.ca into your Contact page and become friends across networks. (Or you can put in the URL to Bob's identi.ca page if you wish). You can also be "partial" friends with somebody on Google Buzz by putting in their gmail address. Google Buzz does not yet support all the protocols we need for direct messaging, but you should be able to follow status updates from within Friendika. You can do the same for Twitter accounts and Diaspora accounts. In fact you can "follow" most anybody or any website that produces a syndication feed (RSS/Atom,etc.). If we can find an information stream and a name to attach to the contact, we'll try to connect with them.
+
+If you have supplied your mailbox connection information on your Settings page, you can enter the email address of anybody that has sent you a message recently and have their email messages show up in your social stream. You can also reply to them from within Friendika.
+
+People can also become friends with you from other networks. If a friend of yours has an identi.ca account, they can become friends with you by putting your Friendika Identity Address into their identi.ca subscription dialog box.
+
+If this happens you will receive a notification. You will need to approve this before the friendship is complete.
+
+Some networks allow people to send you messages without being friends and without your approval. Friendika does not allow this by default, as it would open a gateway for spam. So when you've approved a friend request from one of these networks, look at your contact page for that person (this will be displayed as soon as you approve the relationship). They might be marked as an "Ignored" contact.
+
+This means they can see some of your posts (your public posts), but they aren't permitted to send you anything. You can "Un-ignore" them if you desire to allow them to contact you directly and to have their status updates appear in your Network feed.
+
+When you receive a friendship notification from another Friendika member, you will have the option of allowing them as a "fan" or as a "friend". If they are a fan, they can see what you have to say, including private communications that you send to them, but not vice versa. As a friend, you can both communicate with each other.
+
+Once you have become friends, if you find the person constantly sends you spam or worthless information, you can "Ignore" them - without breaking off the friendship or even alerting them to the fact that you aren't interested in anything they are saying. In many ways they are like a "fan" - but they don't know this. They think they are a friend.
+
+You can also "block" a person. This completely blocks communications with that person. They may still be able to see your public posts, as can anybody in the world, but they cannot communicate with you directly in any way. They will know or be able to discover that they have been blocked but there's nothing they can do about it.
+
+You can also delete a friend no matter what the friendship status - which complete removes everything relating to that person from your website.
+
+
+
+
diff --git a/doc/Message-Flow.md b/doc/Message-Flow.md
new file mode 100644
index 000000000..be2045f79
--- /dev/null
+++ b/doc/Message-Flow.md
@@ -0,0 +1,54 @@
+Friendika Message Flow
+
+This page attempts to document some of the details of how messages get from one person to another in the Friendika network. There are multiple paths, using multiple protocols and message formats.
+
+Those attempting to understand these message flows should become familiar with (at the minimum) the DFRN protocol document (http://dfrn.org/dfrn.pdf) and the message passing elements of the OStatus stack (salmon and Pubsubhubbub).
+
+
+Most message passing involves the file include/items.php, which has functions for several feed-related import/export activities.
+
+When a message is posted, all immediate deliveries to all networks are made using include/notifier.php, which chooses how (and to whom) to deliver the message. This file also invokes the local side of all deliveries including DFRN-notify.
+
+mod/dfrn_notify.php handles the remote side of DFRN-notify.
+
+Local feeds are generated by mod/dfrn_poll.php - which also handles the remote side of DFRN-poll protocol.
+
+Salmon notifications arrive via mod/salmon.php.
+
+Push (pubsubhubbub) feeds arrive via mod/pubsub.php
+
+DFRN-poll feed imports arrive via include/poller.php as a scheduled task, this implements the local side of the DFRN-poll protocol.
+
+
+
+
+Scenario #1. Bob posts a public status message
+
+This is a public message with no conversation members so no private transport is used. There are two paths it can take - as a bbcode path to DFRN clients, and converted to HTML with the server's PuSH (pubsubhubbub) hubs notified. When a PuSH hub is operational, dfrn-poll clients prefer to receive their information through the PuSH channel. They will fall back on a daily poll in case the hub has delivery issues (this is quite common when using the default Google reference hub). If there is no specified hub or hubs, DFRN clients will poll at a configurable (per-contact) rate at up to 5-minute intervals. Feeds retrieved via dfrn-poll are bbcode and may also contain private conversations which the poller has permissions to see.
+
+Scenario #2. Jack replies to Bob's public message. Jack is on the Friendika/DFRN network.
+
+Jack uses dfrn-notify to send a direct reply to Bob. Bob then creates a feed of the conversation and sends it to everybody involved in the conversation using dfrn-notify. PuSH hubs are notified that new content is available. The hub or hubs will then retrieve the latest feed and transmit it to all hub subscribers (which may be on different networks).
+
+Scenario #3. Mary replies to Bob's public message. Mary is on the Friendika/DFRN network.
+
+Mary uses dfrn-notify to send a direct reply to Bob. Bob then creates a feed of the conversation and sends it to everybody involved in the conversation (excluding himself, the conversation is now sent to both Jack and Mary). Messages are sent using dfrn-notify. Push hubs are also notified that new content is available. The hub or hubs will then retrieve the latest feed and transmit it to all hub subscribers (which may be on different networks).
+
+Scenario #4. William replies to Bob's public message. William is on the OStatus network.
+
+William uses salmon to notify Bob of the reply. Content is html embedded in salmon magic envelope. Bob then creates a feed of the conversation and sends it to all Friendika participants involved in the conversation using dfrn-notify (excluding himself, the conversation is sent to both Jack and Mary). Push hubs are notified that new content is available. The hub or hubs will then retrieve the latest feed and transmit it to all hub subscribers (which may be on different networks).
+
+Scenario #5. Bob posts a private message to Mary and Jack.
+
+Message is delivered immediately to Mary and Jack using dfrn_notify. Public hubs are not notified. Requeueing is attempted in case of timeout. Replies follow the same flow as the public replies except that hubs are not notified and message is never made available in the public feed. The entire conversation is also made available to Mary and Jack (and nobody else) through their dfrn-poll personalised feed.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/Pages.md b/doc/Pages.md
new file mode 100644
index 000000000..6f4322b13
--- /dev/null
+++ b/doc/Pages.md
@@ -0,0 +1,28 @@
+Pages
+=====
+
+* [Home](help)
+
+
+Friendika also lets you create group and/or celebrity pages.
+
+Every page in Friendika has a nickname and these must all be unique. This applies to all pages, whether they are normal profiles or group pages.
+
+Therefore the first thing you need to do to create a new page is to register a new account for the page. Please note that the site administrator can restrict and/or regulate the registration of new accounts.
+
+If you create a second account on a system and use the same email address or OpenID account, you will no longer be able to use the email address (or OpenID) to login to the account. You should login using the account nickname instead.
+
+On the new account, visit the 'Settings' page. Towards the end of the page are "Advanced Page Settings". Typically you would use "Normal Account" for a normal personal account. This is the default selection. Group pages provide the ability for people to become friends/fans of the page without requiring approval.
+
+The exact setting you would use depends on how you wish to interact with people who join the page. The "Soapbox" setting let's the page owner control all communications. Everything you post will go out to the page members, but there will be no opportunity for interaction. This setting would typically be used for announcements or corporate communications.
+
+The most common setting is the "Community Account". This creates a group page where all members can freely interact.
+
+The "Automatic Friend Account" is typically used for personal profile pages where you wish to automatically approve any friendship/connection requests.
+
+**Managing Multiple Pages**
+
+We recommend that you create group pages with the same email address and password as your normal account. If you do this, you will find a new "Manage" tab on the menu bar which lets you toggle identities easily and manage your pages. You are not required to do this, but the alternative is to logout and log back into the other account to manage alternate pages - and this could get cumbersome if you manage several different pages/identities.
+
+
+
diff --git a/doc/Plugins.md b/doc/Plugins.md
new file mode 100644
index 000000000..42c04cb26
--- /dev/null
+++ b/doc/Plugins.md
@@ -0,0 +1,289 @@
+**Friendika Addon/Plugin development**
+
+This is an early specification and hook details may be subject to change.
+
+Please see the sample addon 'randplace' for a working example of using some of these features. The facebook addon provides an example of integrating both "addon" and "module" functionality. Addons work by intercepting event hooks - which must be registered. Modules work by intercepting specific page requests (by URL path).
+
+You must register all addons/plugins with the system in the .htconfig.php file.
+
+ $a->config['system']['addon'] = 'plugin1name, plugin2name, another_name';
+
+Plugin names cannot contain spaces and are used as filenames. Each addon must contain both an install and an uninstall function based on the addon/plugin name. For instance "plugin1name_install()". These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your plugin will require. The install and uninstall functions will also be called (i.e. re-installed) if the plugin changes after installation - therefore your uninstall should not destroy data and install should consider that data may already exist. Future extensions may provide for "setup" amd "remove".
+
+
+
+Register your plugin hooks during installation.
+
+ register_hook($hookname, $file, $function);
+
+$hookname is a string and corresponds to a known Friendika hook.
+
+$file is a pathname relative to the top-level Friendika directory. This *should* be 'addon/plugin_name/plugin_name.php' in most cases.
+
+$function is a string and is the name of the function which will be executed when the hook is called.
+
+
+Your hook callback functions will be called with at least one and possibly two arguments
+
+
+ function myhook_function(&$a, &$b) {
+
+
+ }
+
+
+If you wish to make changes to the calling data, you must declare them as
+reference variables (with '&') during function declaration.
+
+$a is the Friendika 'App' class - which contains a wealth of information
+about the current state of Friendika, such as which module has been called,
+configuration info, the page contents at the point the hook was invoked, profile
+and user information, etc. It is recommeded you call this '$a' to match its usage
+elsewhere.
+
+$b can be called anything you like. This is information which is specific to the hook
+currently being processed, and generally contains information that is being immediately
+processed or acted on that you can use, display, or alter. Remember to declare it with
+'&' if you wish to alter it.
+
+**Modules**
+
+Plugins/addons may also act as "modules" and intercept all page requests for a given URL path. In order for a plugin to act as a module it needs to define a function "plugin_name_module()" which takes no arguments and need not do anything.
+
+If this function exists, you will now receive all page requests for "http://my.web.site/plugin_name" - with any number of URL components as additional arguments. These are parsed into an array $a->argv, with a corresponding $a->argc indicating the number of URL components. So http://my.web.site/plugin/arg1/arg2 would look for a module named "plugin" and pass its module functions the $a App structure (which is available to many components). This will include:
+ $a->argc = 3
+ $a->argv = array(0 => 'plugin', 1 => 'arg1', 2 => 'arg2');
+
+Your module functions will often contain the function plugin_name_content(&$a), which defines and returns the page body content. They may also contain plugin_name_post(&$a) which is called before the _content function and typically handles the results of POST forms. You may also have plugin_name_init(&$a) which is called very early on and often does module initialisation.
+
+
+
+**Current hooks:**
+
+**'authenticate'** - called when a user attempts to login.
+ $b is an array
+ 'username' => the supplied username
+ 'password' => the supplied password
+ 'authenticated' => set this to non-zero to authenticate the user.
+ 'user_record' => successful authentication must also return a valid user record from the database
+
+**'logged_in'** - called after a user has successfully logged in.
+ $b contains the $a->user array
+
+
+**'display_item'** - called when formatting a post for display.
+ $b is an array
+ 'item' => The item (array) details pulled from the database
+ 'output' => the (string) HTML representation of this item prior to adding it to the page
+
+**'post_local'** - called when a status post or comment is entered on the local system
+ $b is the item array of the information to be stored in the database
+ {Please note: body contents are bbcode - not HTML)
+
+**'post_local_end'** - called when a local status post or comment has been stored on the local system
+ $b is the item array of the information which has just been stored in the database
+ {Please note: body contents are bbcode - not HTML)
+
+**'post_remote'** - called when receiving a post from another source. This may also be used to post local activity or system generated messages.
+ $b is the item array of information to be stored in the database and the item
+ body is bbcode.
+
+**'settings_form'** - called when generating the HTML for the user Settings page
+ $b is the (string) HTML of the settings page before the final '' tag.
+
+**'settings_post'** - called when the Settings pages are submitted.
+ $b is the $_POST array
+
+**'plugin_settings'** - called when generating the HTML for the addon settings page
+ $b is the (string) HTML of the addon settings page before the final '' tag.
+
+**'plugin_settings_post'** - called when the Addon Settings pages are submitted.
+ $b is the $_POST array
+
+**'profile_post'** - called when posting a profile page.
+ $b is the $_POST array
+
+**'profile_edit'** - called prior to output of profile edit page
+ $b is array
+ 'profile' => profile (array) record from the database
+ 'entry' => the (string) HTML of the generated entry
+
+
+**'profile_advanced'** - called when the HTML is generated for the 'Advanced profile', corresponding to the 'Profile' tab within a person's profile page.
+ $b is the (string) HTML representation of the generated profile
+ (The profile array details are in $a->profile)
+
+**'directory_item'** - called from the Directory page when formatting an item for display
+ $b is an array
+ 'contact' => contact (array) record for the person from the database
+ 'entry' => the (string) HTML of the generated entry
+
+**'profile_sidebar_enter'** - called prior to generating the sidebar "short" profile for a page
+ $b is (array) the person's profile array
+
+**'profile_sidebar'** - called when generating the sidebar "short" profile for a page
+ $b is an array
+ 'profile' => profile (array) record for the person from the database
+ 'entry' => the (string) HTML of the generated entry
+
+**'contact_block_end'** - called when formatting the block of contacts/friends on a profile sidebar has completed
+ $b is an array
+ 'contacts' => array of contacts
+ 'output' => the (string) generated HTML of the contact block
+
+**'bbcode'** - called during conversion of bbcode to html
+ $b is (string) converted text
+
+**'html2bbcode'** - called during conversion of html to bbcode (e.g. remote message posting)
+ $b is (string) converted text
+
+**'page_header'** - called after building the page navigation section
+ $b is (string) HTML of nav region
+
+**'personal_xrd'** - called prior to output of personal XRD file.
+ $b is an array
+ 'user' => the user record for the person
+ 'xml' => the complete XML to be output
+
+**'home_content'** - called prior to output home page content, shown to unlogged users
+ $b is (string) HTML of section region
+
+**'contact_edit'** - called when editing contact details on an individual from the Contacts page
+ $b is (array)
+ 'contact' => contact record (array) of target contact
+ 'output' => the (string) generated HTML of the contact edit page
+
+**'contact_edit_post'** - called when posting the contact edit page
+ $b is the $_POST array
+
+**'init_1'** - called just after DB has been opened and before session start
+ $b is not used or passed
+
+
+**'page_end'** - called after HTML content functions have completed
+ $b is (string) HTML of content div
+
+
+*** = subject to change
+
+Not yet documented (you may view these within the source code):
+
+**'atom_feed'** ***
+
+**'atom_feed_end'** ***
+
+**'parse_atom'** ***
+
+**'atom_author'** ***
+
+**'atom_entry'** ***
+
+A complete list of all hook callbacks with file locations (generated 22-Feb-2011): Please see the source for details of any hooks not documented above.
+
+boot.php: call_hooks('contact_block_end', $arr);
+
+boot.php: call_hooks('profile_sidebar_enter', $profile);
+
+boot.php: call_hooks('profile_sidebar', $arr);
+
+boot.php: call_hooks("proc_run", $args);
+
+include/nav.php: call_hooks('page_header', $a->page['nav']);
+
+include/auth.php: call_hooks('authenticate', $addon_auth);
+
+include/auth.php: call_hooks('logged_in', $a->user);
+
+include/bbcode.php: call_hooks('bbcode',$Text);
+
+include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
+
+include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
+
+include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
+
+include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
+
+include/items.php: call_hooks('atom_feed', $atom);
+
+include/items.php: call_hooks('atom_feed_end', $atom);
+
+include/items.php: call_hooks('atom_feed_end', $atom);
+
+include/items.php: call_hooks('parse_atom', $arr);
+
+include/items.php: call_hooks('post_remote',$arr);
+
+include/items.php: call_hooks('atom_author', $o);
+
+include/items.php: call_hooks('atom_entry', $o);
+
+include/html2bbcode.php: call_hooks('html2bbcode', $text);
+
+index.php: call_hooks('init_1');
+
+index.php:call_hooks('app_menu', $arr);
+
+index.php:call_hooks('page_end', $a->page['content']);
+
+mod/photos.php: call_hooks('photo_post_init', $_POST);
+
+mod/photos.php: call_hooks('photo_post_file',$ret);
+
+mod/photos.php: call_hooks('photo_post_end',intval($item_id));
+
+mod/photos.php: call_hooks('photo_upload_form',$ret);
+
+mod/parse_url.php: call_hooks('parse_link', $arr);
+
+mod/home.php: call_hooks("home_content",$o);
+
+mod/contacts.php: call_hooks('contact_edit_post', $_POST);
+
+mod/contacts.php: call_hooks('contact_edit', $arr);
+
+mod/settings.php: call_hooks('plugin_settings_post', $_POST);
+
+mod/settings.php: call_hooks('settings_post', $_POST);
+
+mod/settings.php: call_hooks('plugin_settings', $o);
+
+mod/settings.php: call_hooks('settings_form',$o);
+
+mod/network.php: call_hooks('jot_tool', $jotplugins);
+
+mod/network.php: call_hooks('jot_networks', $jotnets);
+
+mod/network.php: call_hooks('display_item', $arr);
+
+mod/xrd.php: call_hooks('personal_xrd', $arr);
+
+mod/item.php: call_hooks('post_local_start', $_POST);
+
+mod/item.php: call_hooks('post_local',$datarray);
+
+mod/item.php: call_hooks('post_local_end', $datarray);
+
+mod/profile.php: call_hooks('profile_advanced',$o);
+
+mod/profile.php: call_hooks('jot_tool', $jotplugins);
+
+mod/profile.php: call_hooks('jot_networks', $jotnets);
+
+mod/profile.php: call_hooks('display_item', $arr);
+
+mod/display.php: call_hooks('display_item', $arr);
+
+mod/profiles.php: call_hooks('profile_post', $_POST);
+
+mod/profiles.php: call_hooks('profile_edit', $arr);
+
+mod/cb.php: call_hooks('cb_init');
+
+mod/cb.php: call_hooks('cb_post', $_POST);
+
+mod/cb.php: call_hooks('cb_afterpost');
+
+mod/cb.php: call_hooks('cb_content', $o);
+
+mod/directory.php: call_hooks('directory_item', $arr);
diff --git a/doc/Profiles.md b/doc/Profiles.md
new file mode 100644
index 000000000..631a4331b
--- /dev/null
+++ b/doc/Profiles.md
@@ -0,0 +1,51 @@
+Profiles
+========
+
+* [Home](help)
+
+Friendika has unlimited profiles. You may use different profiles to show different "sides of yourself" to different audiences.
+
+You always have a profile known as your "default" or "public" profile. This profile is always available to the general public and cannot be hidden (there may be rare exceptions on privately run or disconnected sites). You may, and probably should restrict the information you make available on your public profile.
+
+That said, if you want other friends to be able to find you, it helps to have the following information in your public profile...
+
+* Your real name
+* A photo of **you**
+* Your location on the planet, at least to a country level.
+
+Without this basic information, you could get very lonely here. Most people (even your best friends) will not try and connect with somebody that has a fake name or doesn't contain a real photo.
+
+In addition, if you'd like to meet people that share some general interests with you, please take a moment and add some "Public Keywords" to your profile. Such as "music, linux, photography" or whatever. You can add as many keywords as you like.
+
+
+Your default or public profile is also shown to contacts on other networks, since they do not have the ability to view your private profiles. Only members of the Friendika network can see alternate/private profiles.
+
+
+To create an alternate profile, select "Profiles" from the menu of your Friendika site. You may edit an existing profile, change the profile photo, or create a new profile. You may also create a "clone" of an existing profile if you only wish to change a few items but don't wish to enter all the information again.
+
+To assign a profile to specific persons, select the person from your "Contacts" page and click the pencil "Edit" icon. You will find a dropdown box listing the various profiles available. If this box is not selectable, the person is not in a supported network and cannot be assigned a specific profile.
+
+Once a profile has been selected, when the person views your profile from one of the "magic profile links" on their site, they will see the private profile you have assigned. If they are not logged into their site or view your profile from elsewhere, they will see your public profile.
+
+A magic profile link is indicated by a special cursor when hovering over a contact's name or photo. Currently this cursor is a hand next to a small padlock. These magic cursors indicate that by following the link, you are able to access special areas of the other person's pages which are only available to friends and may not be available to the general public.
+
+You may also discover that (assuming you have the proper permissions) you may be able to post directly on the other person's profile (often called a "wall-to-wall" post). You may also be able to comment directly on posts from while visiting the other person's profile page.
+
+There are two settings which allow you to publish your profile to a directory and ensure that it can be found by others. You can change these through settings on the "Settings" page. One setting allows you to publish your profile in the site directory of this Friendika server. Another option (this may have been disabled by the site creator) allows you to publish your profile in the "Global Directory". This is a mega directory which contains people from many other Friendika installations world-wide.
+
+If you do not wish to be visible to any of these sites, you may leave your profile unpublished.
+
+Although you may have multiple profiles, you only have one profile photo. This is intentional. In early tests we experimented with different photos for each profile and found it was very confusing for people. They might see a different picture depending on what website they visited or what conversation they were in, and often alerted them to the fact that other people might be able to see different profiles of you than they could see.
+
+(But you can use the rich-text information boxes within a profile such as "Tell us about yourself" and link other photos onto the page.)
+
+**Keywords and Directory Search**
+
+On the site Directory page, you may search for people with published profiles who are on this site. The search is typically for your nickname or part of your full name. However this search will also match against other profile fields - such as gender, location, "about", work, and education. You may also include "Keywords" in your default profile - which may be used to search for common interests with other members. You have two sets of keywords available - public and private. Private keywords are *not* visible to anybody. You could use these keywords to locate people who share membership in secret societies, or that share a love of fishing (for example) - without making this information visible on your public profile. Public keywords are used in the friend suggestion tool and although they aren't readily visible, they may be seen by viewing the HTML of your profile page.
+
+Directory searches are also able to use "boolean" logic so that you can search for "+lesbian +Florida" and find those who's sexual preference (or keywords) contain the world "lesbian" and that live in Florida. See the section on "Topical Tags" on the [[Tags-and-Mentions]] page for more information on performing boolean searches.
+
+On your Contacts page is a link to "Find People with Shared Interests" (unless your site administrator has disabled the global directory). This will combine both your public and private keywords, and find people in the global directory who have matching and/or similar keywords. (Your private keywords are not identified or stored on the global directory). The more keywords you provide, the more relevant the search results that are returned. These are sorted by relevance. You may discover that you are the first person on the list - because you are very likely the most relevant match for your keywords in the directory.
+
+
+
\ No newline at end of file
diff --git a/doc/Remove-Account.md b/doc/Remove-Account.md
new file mode 100644
index 000000000..10c5d5cfe
--- /dev/null
+++ b/doc/Remove-Account.md
@@ -0,0 +1,13 @@
+Remove Account
+==============
+
+* [Home](help)
+
+We don't like to see people leave Friendika, but if you need to remove your account, you should visit the URL
+
+http://friendika-site/removeme
+
+with your web browser. You will need to be logged in at the time. (Replace "friendika-site" with the hostname of your Friendika server)
+
+You will be asked for your password to confirm the request. If this matches your stored password, your account will immediately be removed. Unlike some social networks we do **not** hold onto it for a grace period in case you change your mind. Your user details, your conversations, your photos, your friends - everything; will be removed immediately and you will be logged out.
+
diff --git a/doc/Settings.md b/doc/Settings.md
new file mode 100644
index 000000000..8abb8a567
--- /dev/null
+++ b/doc/Settings.md
@@ -0,0 +1,237 @@
+Here are some of the built-in features which don't have an exposed interface or are otherwise undocumented. Configuration settings are stored in the file ".htconfig.php". Edit this file with a text editor to make the desired changes. Several system settings are already documented in that file and will not be covered here.
+
+**Hot Keys**
+
+Friendika traps the following keyboard events:
+
+* [Pause] - Pauses "Ajax" update activity. This is the process that provides updates without reloading the page. You may wish to pause it to reduce network usage and/or as a debugging aid for javascript developers. A pause indicator will appear at the lower right hand corner of the page. Hit the [pause] key once again to resume.
+
+* [F8] - Displays a language selector
+
+
+**Birthday Notifications**
+
+Birthday events are published on your Home page for any friends having a birthday in the coming 6 days. In order for your birthday to be discoverable by all of your friends, you must set your birthday (at least the month and day) in your default profile. You are not required to provide the year.
+
+**Configuration settings**
+
+
+**Language**
+
+System Setting
+
+Please see util/README for information on creating language translations.
+
+Config:
+```
+$a->config['system']['language'] = 'name';
+```
+
+
+**System Theme**
+
+System Setting
+
+Choose a named theme to be the default system theme (which may be over-ridden by user profiles). Default theme is "default".
+
+Config:
+```
+$a->config['system']['theme'] = 'theme-name';
+```
+
+
+**Verify SSL Certitificates**
+
+Security setting
+
+By default Friendika allows SSL communication between websites that have "self-signed" SSL certificates. For the widest compatibility with browsers and other networks we do not recommend using self-signed certificates, but we will not prevent you from using them. SSL encrypts all the data transmitted between sites (and to your browser) and this allows you to have completely encrypted communications, and also protect your login session from hijacking. Self-signed certificates can be generated for free, without paying top-dollar for a website SSL certificate - however these aren't looked upon favourably in the security community because they can be subject to so-called "man-in-the-middle" attacks. If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.
+
+Config:
+```
+$a->config['system']['verifyssl'] = true;
+```
+
+
+**Allowed Friend Domains**
+
+Corporate/Edu enhancement
+
+Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. (Wildcard support on Windows platforms requires PHP5.3). By default, any (valid) domain may establish friendships with this site.
+
+Config:
+```
+$a->config['system']['allowed_sites'] = "sitea.com, *siteb.com";
+```
+
+
+**Allowed Email Domains**
+
+Corporate/Edu enhancement
+
+Comma separated list of domains which are allowed in email addresses for registrations to this site. This can lockout those who are not part of this organisation from registering here. Wildcards are accepted. (Wildcard support on Windows platforms requires PHP5.3). By default, any (valid) email address is allowed in registrations.
+
+Config:
+```
+$a->config['system']['allowed_email'] = "sitea.com, *siteb.com";
+```
+
+**Block Public**
+
+Corporate/Edu enhancement
+
+Set to true to block public access to all otherwise public personal pages on this site unless you are currently logged in. This blocks the viewing of profiles, friends, photos, the site directory and search pages to unauthorised persons. A side effect is that entries from this site will not appear in the global directory. We recommend specifically disabling that also (setting is described elsewhere on this page). Note: this is specifically for sites that desire to be "standalone" and do not wish to be connected to any other Friendika sites. Unauthorised persons will also not be able to request friendship with site members. Default is false. Available in version 2.2 or greater.
+
+Config:
+```
+$a->config['system']['block_public'] = true;
+```
+
+
+**Force Publish**
+
+Corporate/Edu enhancement
+
+By default, each user can choose on their Settings page whether or not to have their profile published in the site directory. This setting forces all
+profiles on this site to be listed in the site directory and there is no option provided to the user to change it. Default is false.
+
+Config:
+```
+$a->config['system']['publish_all'] = true;
+```
+
+
+**Global Directory**
+
+Corporate/Edu enhancement
+
+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.
+
+```
+$a->config['system']['directory_submit_url'] = 'http://dir.friendika.com/submit';
+```
+
+
+**Proxy Configuration Settings**
+
+If your site uses a proxy to connect to the internet, you may use these settings to communicate with the outside world (the outside world still needs to be able to see your website, or this will not be very useful).
+
+Config:
+```
+$a->config['system']['proxy'] = "http://proxyserver.domain:port";
+$a->config['system']['proxyuser'] = "username:password";
+```
+
+
+**Network Timeout**
+
+How long to wait on a network communication before timing out. Value is in seconds. Default is 60 seconds. Set to 0 for unlimited (not recommended).
+
+Config:
+```
+$a->config['system']['curl_timeout'] = 60;
+```
+
+
+**Banner/Logo**
+
+Set the content for the site banner. Default is the Friendika logo and name. You may wish to provide HTML/CSS to style and/or position this content, as it may not be themed by default.
+
+Config:
+```
+$a->config['system']['banner'] = 'My Great Website';
+```
+
+
+**Maximum Image Size**
+
+Maximum size in bytes of uploaded images. Default is 0, which means no limits.
+
+Config:
+```
+$a->config['system']['maximagesize'] = 1000000;
+```
+
+
+**UTF-8 Regular Expressions**
+
+During registrations, full names are checked using UTF-8 regular expressions. This requires PHP to have been compiled with a special setting to allow UTF-8 expressions. If you are completely unable to register accounts, set no_utf to true. Default is false (meaning UTF8 regular expressions are supported and working).
+
+Config:
+```
+$a->config['system']['no_utf'] = true;
+```
+
+
+**Check Full Names**
+
+You may find a lot of spammers trying to register on your site. During testing we discovered that since these registrations were automatic, the "Full Name" field was often set to just an account name with no space between first and last name. If you would like to support people with only one name as their full name, you may change this setting to true. Default is false.
+
+Config:
+```
+$a->config['system']['no_regfullname'] = true;
+```
+
+
+**Gravatars**
+
+During registration, we will try to automatically find a user photo for you on the web using the gravatar service. You may turn this off by setting 'no_gravatar' to true. Default is false.
+
+Config:
+```
+$a->config['system']['no_gravatar'] = true;
+```
+
+
+**OpenID**
+
+By default, OpenID may be used for both registration and logins. If you do not wish to make OpenID facilities available on your system (at all), set 'no_openid' to true. Default is false.
+
+Config:
+```
+$a->config['system']['no_openid'] = true;
+```
+
+
+**Multiple Registrations**
+
+The ability to create "Pages" requires a person to register more than once. Your site configuration can block registration (or require approval to register). By default logged in users can register additional accounts for use as pages. These will still require approval if REGISTER_APPROVE is selected. You may prohibit logged in users from creating additional accounts by setting 'block_extended_register' to true. Default is false.
+
+Config:
+```
+$a->config['system']['block_extended_register'] = true;
+```
+
+
+**Developer Settings**
+
+Most useful when debugging protocol exchanges and tracking down other communications issues.
+
+Config:
+
+```
+$a->config['system']['debugging'] = true;
+$a->config['system']['logfile'] = 'logfile.out';
+$a->config['system']['loglevel'] = LOGGER_DEBUG;
+```
+Turns on detailed debugging logs which will be stored in 'logfile.out' (which must be writeable by the webserver). LOGGER_DEBUG will show a good deal of information about system activity but will not include detailed data. You may also select LOGGER_ALL but due to the volume of information we recommend only enabling this when you are tracking down a specific problem. Other log levels are possible but are not being used at the present time.
+
+
+**PHP error logging**
+
+Use the following settings to redirect PHP errors to a file.
+
+Config:
+
+```
+error_reporting(E_ERROR | E_WARNING | E_PARSE );
+ini_set('error_log','php.out');
+ini_set('log_errors','1');
+ini_set('display_errors', '0');
+```
+
+This will put all PHP errors in the file php.out (which must be writeable by the webserver). Undeclared variables are occasionally referenced in the program and therefore we do not recommend using E_NOTICE or E_ALL. The vast majority of issues reported at these levels are completely harmless. Please report to the developers any errors you encounter in the logs using the recommended settings above. They generally indicate issues which need to be resolved.
+
+If you encounter a blank (white) page when using the application, view the PHP logs - as this almost always indicates an error has occurred.
+
+
+
diff --git a/doc/Sites-running-Friendika-you-can-join.md b/doc/Sites-running-Friendika-you-can-join.md
new file mode 100644
index 000000000..8127a5b9c
--- /dev/null
+++ b/doc/Sites-running-Friendika-you-can-join.md
@@ -0,0 +1,7 @@
+Here is a list of Friendika installations free for everybody to join:
+
+* [friendika.com](http://demo.friendika.com)
+* [friendika.net](http://www.friendika.net)
+* [aphasi.cc](https://friendika.aphasi.cc)
+* [openmindspace.org](http://friendika.openmindspace.org)
+* [dfrn.net](http://dfrn.net/)
\ No newline at end of file
diff --git a/doc/Tags-and-Mentions.md b/doc/Tags-and-Mentions.md
new file mode 100644
index 000000000..404da7465
--- /dev/null
+++ b/doc/Tags-and-Mentions.md
@@ -0,0 +1,37 @@
+Tags and Mentions
+=================
+
+
+* [Home](help)
+
+
+Like many other modern social networks, Friendika uses a special notation inside messages to indicate "tags" or contextual links to other entities.
+
+**Mentions**
+
+People are tagged by preceding their name with the @ character.
+
+The following are various ways of indicating a person:
+
+* @mike - indicates a known contact in your social circle whose nickname is "mike"
+* @mike_macgirvin - indicates a known contact in your social circle whose full name is "Mike Macgirvin". Note that spaces cannot be used inside tags.
+* @mike@macgirvin.com - indicates the Identity Address of a person on a different network, or one that is *not* in your social circle. This can only be an email-style locator, not a web URL.
+
+Unless their system blocks unsolicited "mentions", the person tagged will likely receive a "Mention" post/activity or become a direct participant in the conversation in the case of public posts. Please note that Friendika often blocks incoming "mentions" from other networks and especially from people with no relationship to you. This is a spam prevention measure.
+
+Friendika makes no distinction between people and groups for the purpose of tagging. (Some other networks use !group to indicate a group.)
+
+**Topical Tags**
+
+Topical tags are indicated by preceding the tag name with the # character. This will create a link in the post to a generalised site search for the term provided. For example, #cars will provide a search link for all posts mentioning 'cars' on your site. Topical tags are generally a minimum of three characters in length. Shorter search terms are not likely to yield any search results, although this depends on the database configuration. The same rules apply as with names that spaces within tags are represented by the underscore character. It is therefore not possible to create a tag whose target contains an underscore.
+
+Tag searches may also use "boolean" logic.
+
+* \#bike - creates a search for "bike"
+* \#bike_red - creates a search for posts that contain either the word "bike" OR the word "red".
+* \#+bike_+red - creates a search for posts that contain both the word "bike" AND the word "red"
+* \#+bike_-blue - creates a search for posts that contain the word "bike" but do *not* contain the word "blue"
+
+
+
+
diff --git a/doc/developer b/doc/developer
new file mode 100644
index 000000000..1dfd0503b
--- /dev/null
+++ b/doc/developer
@@ -0,0 +1,18 @@
+Friendika Developer Guide
+
+Here is how you can join us.
+
+First, get yourself a working git package on the system where you will be
+doing development.
+
+Create your own github account.
+
+Follow the instructions provided here: [[http://help.github.com/fork-a-repo/]]
+to create and use your own tracking fork on github
+
+Then go to your github page and create a "Pull request" when you are ready
+to notify us to merge your work.
+
+**Important**
+
+Please pull in any changes from the project repository and merge them with your work **before** issuing a pull request. We reserve the right to reject any patch which results in a large number of merge conflicts. This is especially true in the case of language translations - where we may not be able to understand the subtle differences between conflicting versions.
\ No newline at end of file
diff --git a/htconfig.php b/htconfig.php
index fb62245d2..0f9222ac5 100644
--- a/htconfig.php
+++ b/htconfig.php
@@ -38,7 +38,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
// maximum size of uploaded photos
diff --git a/images/article.gif b/images/article.gif
new file mode 100644
index 000000000..91aeef000
Binary files /dev/null and b/images/article.gif differ
diff --git a/images/audio.gif b/images/audio.gif
new file mode 100644
index 000000000..4be977116
Binary files /dev/null and b/images/audio.gif differ
diff --git a/images/friendika-1600.png b/images/friendika-1600.png
new file mode 100644
index 000000000..615a81dd9
Binary files /dev/null and b/images/friendika-1600.png differ
diff --git a/images/icons.png b/images/icons.png
new file mode 100644
index 000000000..734c75f73
Binary files /dev/null and b/images/icons.png differ
diff --git a/images/pencil.gif b/images/pencil.gif
new file mode 100644
index 000000000..26bfb0c9a
Binary files /dev/null and b/images/pencil.gif differ
diff --git a/images/recycle.gif b/images/recycle.gif
new file mode 100644
index 000000000..01b3e13b4
Binary files /dev/null and b/images/recycle.gif differ
diff --git a/images/remote-link.gif b/images/remote-link.gif
index 008397fe8..64de29aee 100644
Binary files a/images/remote-link.gif and b/images/remote-link.gif differ
diff --git a/images/share.gif b/images/share.gif
new file mode 100644
index 000000000..035fa2e38
Binary files /dev/null and b/images/share.gif differ
diff --git a/images/spencil.gif b/images/spencil.gif
new file mode 100644
index 000000000..0a2551ac0
Binary files /dev/null and b/images/spencil.gif differ
diff --git a/images/tools.png b/images/tools.png
new file mode 100644
index 000000000..c17094a81
Binary files /dev/null and b/images/tools.png differ
diff --git a/images/video.gif b/images/video.gif
new file mode 100644
index 000000000..e4d5e8cdd
Binary files /dev/null and b/images/video.gif differ
diff --git a/include/Contact.php b/include/Contact.php
index 7cac3c0e0..4ca77d065 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -14,11 +14,13 @@ function user_remove($uid) {
q("DELETE FROM `group` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `group_member` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `intro` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `event` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `item` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `mail` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `photo` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `pconfig` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `user` WHERE `uid` = %d", intval($uid));
if($uid == local_user()) {
unset($_SESSION['authenticated']);
@@ -41,6 +43,9 @@ function contact_remove($id) {
q("DELETE FROM `mail` WHERE `contact-id` = %d ",
intval($id)
);
+ q("DELETE FROM `event` WHERE `cid` = %d ",
+ intval($id)
+ );
}
diff --git a/include/Photo.php b/include/Photo.php
index 9934b9a39..707b0de5d 100644
--- a/include/Photo.php
+++ b/include/Photo.php
@@ -162,12 +162,20 @@ class Photo {
}
public function saveImage($path) {
- imagejpeg($this->image,$path,100);
+ $quality = get_config('system','jpeg_quality');
+ if((! $quality) || ($quality > 100))
+ $quality = JPEG_QUALITY;
+ imagejpeg($this->image,$path,$quality);
}
public function imageString() {
ob_start();
- imagejpeg($this->image,NULL,100);
+
+ $quality = get_config('system','jpeg_quality');
+ if((! $quality) || ($quality > 100))
+ $quality = JPEG_QUALITY;
+
+ imagejpeg($this->image,NULL,$quality);
$s = ob_get_contents();
ob_end_clean();
return $s;
diff --git a/include/Scrape.php b/include/Scrape.php
index ff9899252..7fc0c964b 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -216,7 +216,7 @@ function scrape_feed($url) {
}
if(stristr($line,'application/rss+xml') || stristr($s,'getElementsByTagName('link');
- // get Atom link elements
+ $items = $dom->getElementsByTagName('img');
- foreach($items as $item) {
- $x = $item->getAttribute('rel');
- if(($x === 'alternate') && ($item->getAttribute('type') === 'application/atom+xml'))
- $ret['feed_atom'] = $item->getAttribute('href');
- if(($x === 'alternate') && ($item->getAttribute('type') === 'application/rss+xml'))
- $ret['feed_rss'] = $item->getAttribute('href');
+ // get img elements (twitter)
+
+ if($items) {
+ foreach($items as $item) {
+ $x = $item->getAttribute('id');
+ if($x === 'profile-image') {
+ $ret['photo'] = $item->getAttribute('src');
+ }
+ }
}
+
+ $head = $dom->getElementsByTagName('base');
+ if($head) {
+ foreach($head as $head0) {
+ $basename = $head0->getAttribute('href');
+ break;
+ }
+ }
+ if(! $basename)
+ $basename = substr($url,0,strrpos($url,'/')) . '/';
+
+ $items = $dom->getElementsByTagName('link');
+
+ // get Atom/RSS link elements, take the first one of either.
+
+ if($items) {
+ foreach($items as $item) {
+ $x = $item->getAttribute('rel');
+ if(($x === 'alternate') && ($item->getAttribute('type') === 'application/atom+xml')) {
+ if(! x($ret,'feed_atom'))
+ $ret['feed_atom'] = $item->getAttribute('href');
+ }
+ if(($x === 'alternate') && ($item->getAttribute('type') === 'application/rss+xml')) {
+ if(! x($ret,'feed_rss'))
+ $ret['feed_rss'] = $item->getAttribute('href');
+ }
+ }
+ }
+
+ // Drupal and perhaps others only provide relative URL's. Turn them into absolute.
+
+ if(x($ret,'feed_atom') && (! strstr($ret['feed_atom'],'://')))
+ $ret['feed_atom'] = $basename . $ret['feed_atom'];
+ if(x($ret,'feed_rss') && (! strstr($ret['feed_rss'],'://')))
+ $ret['feed_rss'] = $basename . $ret['feed_rss'];
+
return $ret;
-}}
\ No newline at end of file
+}}
+
+
+function probe_url($url) {
+ require_once('include/email.php');
+
+ $result = array();
+
+ if(! $url)
+ return $result;
+
+ $diaspora = false;
+ $email_conversant = false;
+
+ if($url) {
+ $links = lrdd($url);
+
+ if(count($links)) {
+ logger('probe_url: found lrdd links: ' . print_r($links,true), LOGGER_DATA);
+ foreach($links as $link) {
+ if($link['@attributes']['rel'] === NAMESPACE_DFRN)
+ $dfrn = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === 'salmon')
+ $notify = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === NAMESPACE_FEED)
+ $poll = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === 'http://microformats.org/profile/hcard')
+ $hcard = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')
+ $profile = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === 'http://joindiaspora.com/seed_location')
+ $diaspora = true;
+ }
+
+ // Status.Net can have more than one profile URL. We need to match the profile URL
+ // to a contact on incoming messages to prevent spam, and we won't know which one
+ // to match. So in case of two, one of them is stored as an alias. Only store URL's
+ // and not webfinger user@host aliases. If they've got more than two non-email style
+ // aliases, let's hope we're lucky and get one that matches the feed author-uri because
+ // otherwise we're screwed.
+
+ foreach($links as $link) {
+ if($link['@attributes']['rel'] === 'alias') {
+ if(strpos($link['@attributes']['href'],'@') === false) {
+ if(isset($profile)) {
+ if($link['@attributes']['href'] !== $profile)
+ $alias = unamp($link['@attributes']['href']);
+ }
+ else
+ $profile = unamp($link['@attributes']['href']);
+ }
+ }
+ }
+ }
+ else {
+
+ // Check email
+
+ $orig_url = $url;
+ if((strpos($orig_url,'@')) && validate_email($orig_url)) {
+ $x = q("SELECT `prvkey` FROM `user` WHERE `uid` = %d LIMIT 1",
+ intval(local_user())
+ );
+ $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
+ intval(local_user())
+ );
+ if(count($x) && count($r)) {
+ $mailbox = construct_mailbox_name($r[0]);
+ $password = '';
+ openssl_private_decrypt(hex2bin($r[0]['pass']),$password,$x[0]['prvkey']);
+ $mbox = email_connect($mailbox,$r[0]['user'],$password);
+ unset($password);
+ }
+ if($mbox) {
+ $msgs = email_poll($mbox,$orig_url);
+ if(count($msgs)) {
+ $addr = $orig_url;
+ $network = NETWORK_MAIL;
+ $name = substr($url,0,strpos($url,'@'));
+ $profile = 'http://' . substr($url,strpos($url,'@')+1);
+ // fix nick character range
+ $vcard = array('fn' => $name, 'nick' => $name, 'photo' => gravatar_img($url));
+ $notify = 'smtp ' . random_string();
+ $poll = 'email ' . random_string();
+ $priority = 0;
+ $x = email_msg_meta($mbox,$msgs[0]);
+ if(stristr($x->from,$orig_url))
+ $adr = imap_rfc822_parse_adrlist($x->from,'');
+ elseif(stristr($x->to,$orig_url))
+ $adr = imap_rfc822_parse_adrlist($x->to,'');
+ if(isset($adr) && strlen($adr[0]->personal))
+ $vcard['fn'] = notags($adr[0]->personal);
+ }
+ imap_close($mbox);
+ }
+ }
+ }
+ }
+
+ if(strlen($dfrn)) {
+ $ret = scrape_dfrn($dfrn);
+ if(is_array($ret) && x($ret,'dfrn-request')) {
+ $network = NETWORK_DFRN;
+ $request = $ret['dfrn-request'];
+ $confirm = $ret['dfrn-confirm'];
+ $notify = $ret['dfrn-notify'];
+ $poll = $ret['dfrn-poll'];
+ }
+ }
+
+ if($network !== NETWORK_DFRN && $network !== NETWORK_MAIL) {
+ $network = NETWORK_OSTATUS;
+ $priority = 0;
+
+ if($hcard) {
+ $vcard = scrape_vcard($hcard);
+
+ // Google doesn't use absolute url in profile photos
+
+ if((x($vcard,'photo')) && substr($vcard['photo'],0,1) == '/') {
+ $h = @parse_url($hcard);
+ if($h)
+ $vcard['photo'] = $h['scheme'] . '://' . $h['host'] . $vcard['photo'];
+ }
+
+ logger('probe_url: scrape_vcard: ' . print_r($vcard,true), LOGGER_DATA);
+ }
+
+ if(! $profile) {
+ if($diaspora)
+ $profile = $hcard;
+ else
+ $profile = $url;
+ }
+
+ if(! x($vcard,'fn'))
+ if(x($vcard,'nick'))
+ $vcard['fn'] = $vcard['nick'];
+
+ if((! isset($vcard)) && (! $poll)) {
+
+ $ret = scrape_feed($url);
+ logger('probe_url: scrape_feed returns: ' . print_r($ret,true), LOGGER_DATA);
+ if(count($ret) && ($ret['feed_atom'] || $ret['feed_rss'])) {
+ $poll = ((x($ret,'feed_atom')) ? unamp($ret['feed_atom']) : unamp($ret['feed_rss']));
+ $vcard = array();
+ if(x($ret,'photo'))
+ $vcard['photo'] = $ret['photo'];
+ require_once('simplepie/simplepie.inc');
+ $feed = new SimplePie();
+ $xml = fetch_url($poll);
+
+ $feed->set_raw_data($xml);
+
+ $feed->init();
+
+ if(! x($vcard,'photo'))
+ $vcard['photo'] = $feed->get_image_url();
+ $author = $feed->get_author();
+ if($author) {
+ $vcard['fn'] = unxmlify(trim($author->get_name()));
+ if(! $vcard['fn'])
+ $vcard['fn'] = trim(unxmlify($author->get_email()));
+ if(strpos($vcard['fn'],'@') !== false)
+ $vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
+ $vcard['nick'] = strtolower(notags(unxmlify($vcard['fn'])));
+ if(strpos($vcard['nick'],' '))
+ $vcard['nick'] = trim(substr($vcard['nick'],0,strpos($vcard['nick'],' ')));
+ $email = unxmlify($author->get_email());
+ }
+ else {
+ $item = $feed->get_item(0);
+ if($item) {
+ $author = $item->get_author();
+ if($author) {
+ $vcard['fn'] = trim(unxmlify($author->get_name()));
+ if(! $vcard['fn'])
+ $vcard['fn'] = trim(unxmlify($author->get_email()));
+ if(strpos($vcard['fn'],'@') !== false)
+ $vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
+ $vcard['nick'] = strtolower(unxmlify($vcard['fn']));
+ if(strpos($vcard['nick'],' '))
+ $vcard['nick'] = trim(substr($vcard['nick'],0,strpos($vcard['nick'],' ')));
+ $email = unxmlify($author->get_email());
+ }
+ if(! $vcard['photo']) {
+ $rawmedia = $item->get_item_tags('http://search.yahoo.com/mrss/','thumbnail');
+ if($rawmedia && $rawmedia[0]['attribs']['']['url'])
+ $vcard['photo'] = unxmlify($rawmedia[0]['attribs']['']['url']);
+ }
+ }
+ }
+ if((! $vcard['photo']) && strlen($email))
+ $vcard['photo'] = gravatar_img($email);
+ if($poll === $profile)
+ $lnk = $feed->get_permalink();
+ if(isset($lnk) && strlen($lnk))
+ $profile = $lnk;
+ if(! (x($vcard,'fn')))
+ $vcard['fn'] = notags($feed->get_title());
+ if(! (x($vcard,'fn')))
+ $vcard['fn'] = notags($feed->get_description());
+ $network = 'feed';
+ $priority = 2;
+ }
+ }
+ }
+
+ if(! x($vcard,'photo')) {
+ $a = get_app();
+ $vcard['photo'] = $a->get_baseurl() . '/images/default-profile.jpg' ;
+ }
+ $vcard['fn'] = notags($vcard['fn']);
+ $vcard['nick'] = notags($vcard['nick']);
+
+
+ $result['name'] = $vcard['fn'];
+ $result['nick'] = $vcard['nick'];
+ $result['url'] = $profile;
+ $result['addr'] = $addr;
+ $result['notify'] = $notify;
+ $result['poll'] = $poll;
+ $result['request'] = $request;
+ $result['confirm'] = $confirm;
+ $result['photo'] = $vcard['photo'];
+ $result['priority'] = $priority;
+ $result['network'] = $network;
+ $result['alias'] = $alias;
+
+ logger('probe_url: ' . print_r($result,true), LOGGER_DEBUG);
+
+ return $result;
+}
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index fa700818f..b1bcf5108 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -48,7 +48,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$o = '';
- // When used for private messages, we limit correspondence to mutual friends and the selector
+ // When used for private messages, we limit correspondence to mutual DFRN/Friendika friends and the selector
// to one recipient. By default our selector allows multiple selects amongst all contacts.
$sql_extra = '';
@@ -57,9 +57,12 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$sql_extra .= sprintf(" AND `rel` = %d ", intval(REL_BUD));
}
- if($privmail || $privatenet) {
+ if($privmail) {
$sql_extra .= " AND `network` IN ( 'dfrn' ) ";
- }
+ }
+ elseif($privatenet) {
+ $sql_extra .= " AND `network` IN ( 'dfrn', 'mail', 'face' ) ";
+ }
if($privmail)
$o .= "