diff --git a/boot.php b/boot.php
index 1815d37e2..0bd201a25 100644
--- a/boot.php
+++ b/boot.php
@@ -9,9 +9,9 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1306' );
+define ( 'FRIENDICA_VERSION', '2.3.1311' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1137 );
+define ( 'DB_UPDATE_VERSION', 1138 );
define ( 'EOL', "
\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -20,14 +20,14 @@ define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
/**
*
* Image storage quality. Lower numbers save space at cost of image detail.
- * For ease of upgrade, please do not change here. Change jpeg quality with
- * $a->config['system']['jpeg_quality'] = n;
- * in .htconfig.php, where n is netween 1 and 100, and with very poor results
- * below about 50
+ * For ease of upgrade, please do not change here. Change jpeg quality with
+ * $a->config['system']['jpeg_quality'] = n;
+ * in .htconfig.php, where n is netween 1 and 100, and with very poor results
+ * below about 50
*
*/
-define ( 'JPEG_QUALITY', 100 );
+define ( 'JPEG_QUALITY', 100 );
/**
* SSL redirection policies
@@ -68,7 +68,7 @@ define ( 'CONTACT_IS_FRIEND', 3);
/**
* Hook array order
*/
-
+
define ( 'HOOK_HOOK', 0);
define ( 'HOOK_FILE', 1);
define ( 'HOOK_FUNCTION', 2);
@@ -79,9 +79,9 @@ define ( 'HOOK_FUNCTION', 2);
*
* PAGE_NORMAL is a typical personal profile account
* PAGE_SOAPBOX automatically approves all friend requests as CONTACT_IS_SHARING, (readonly)
- * PAGE_COMMUNITY automatically approves all friend requests as CONTACT_IS_SHARING, but with
+ * PAGE_COMMUNITY automatically approves all friend requests as CONTACT_IS_SHARING, but with
* write access to wall and comments (no email and not included in page owner's ACL lists)
- * PAGE_FREELOVE automatically approves all friend requests as full friends (CONTACT_IS_FRIEND).
+ * PAGE_FREELOVE automatically approves all friend requests as full friends (CONTACT_IS_FRIEND).
*
*/
@@ -93,7 +93,7 @@ define ( 'PAGE_BLOG', 4 );
define ( 'PAGE_PRVGROUP', 5 );
/**
- * Network and protocol family types
+ * Network and protocol family types
*/
define ( 'NETWORK_DFRN', 'dfrn'); // Friendica, Mistpark, other DFRN implementations
@@ -103,13 +103,13 @@ define ( 'NETWORK_FEED', 'feed'); // RSS/Atom feeds with no known
define ( 'NETWORK_DIASPORA', 'dspr'); // Diaspora
define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP
define ( 'NETWORK_MAIL2', 'mai2'); // extended IMAP/POP
-define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API
+define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API
define ( 'NETWORK_LINKEDIN', 'lnkd'); // LinkedIn
-define ( 'NETWORK_XMPP', 'xmpp'); // XMPP
+define ( 'NETWORK_XMPP', 'xmpp'); // XMPP
define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace
define ( 'NETWORK_GPLUS', 'goog'); // Google+
-/*
+/**
* These numbers are used in stored permissions
* and existing allocations MUST NEVER BE CHANGED
* OR RE-ASSIGNED! You may only add to them.
@@ -166,7 +166,7 @@ define ( 'NOTIFY_SYSTEM', 0x8000 );
*/
define ( 'NAMESPACE_ZOT', 'http://purl.org/macgirvin/zot' );
-define ( 'NAMESPACE_DFRN' , 'http://purl.org/macgirvin/dfrn/1.0' );
+define ( 'NAMESPACE_DFRN' , 'http://purl.org/macgirvin/dfrn/1.0' );
define ( 'NAMESPACE_THREAD' , 'http://purl.org/syndication/thread/1.0' );
define ( 'NAMESPACE_TOMB' , 'http://purl.org/atompub/tombstones/1.0' );
define ( 'NAMESPACE_ACTIVITY', 'http://activitystrea.ms/spec/1.0/' );
@@ -206,6 +206,7 @@ define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' );
define ( 'ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' );
define ( 'ACTIVITY_OBJ_EVENT', NAMESPACE_ACTIVITY_SCHEMA . 'event' );
define ( 'ACTIVITY_OBJ_TAGTERM', NAMESPACE_DFRN . '/tagterm' );
+define ( 'ACTIVITY_OBJ_PROFILE', NAMESPACE_DFRN . '/profile' );
/**
* item weight for query ordering
@@ -232,19 +233,19 @@ function startup() {
if (get_magic_quotes_gpc()) {
- $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
- while (list($key, $val) = each($process)) {
- foreach ($val as $k => $v) {
- unset($process[$key][$k]);
- if (is_array($v)) {
- $process[$key][stripslashes($k)] = $v;
- $process[] = &$process[$key][stripslashes($k)];
- } else {
- $process[$key][stripslashes($k)] = stripslashes($v);
- }
- }
- }
- unset($process);
+ $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
+ while (list($key, $val) = each($process)) {
+ foreach ($val as $k => $v) {
+ unset($process[$key][$k]);
+ if (is_array($v)) {
+ $process[$key][stripslashes($k)] = $v;
+ $process[] = &$process[$key][stripslashes($k)];
+ } else {
+ $process[$key][stripslashes($k)] = stripslashes($v);
+ }
+ }
+ }
+ unset($process);
}
}
@@ -255,276 +256,278 @@ function startup() {
*
* Our main application structure for the life of this page
* Primarily deals with the URL that got us here
- * and tries to make some sense of it, and
+ * and tries to make some sense of it, and
* stores our page contents and config storage
- * and anything else that might need to be passed around
- * before we spit the page out.
+ * and anything else that might need to be passed around
+ * before we spit the page out.
*
*/
if(! class_exists('App')) {
-class App {
+ class App {
- public $module_loaded = false;
- public $query_string;
- public $config;
- public $page;
- public $profile;
- public $user;
- public $cid;
- public $contact;
- public $contacts;
- public $page_contact;
- public $content;
- public $data = array();
- public $error = false;
- public $cmd;
- public $argv;
- public $argc;
- public $module;
- public $pager;
- public $strings;
- public $path;
- public $hooks;
- public $timezone;
- public $interactive = true;
- public $plugins;
- public $apps = array();
- public $identities;
+ public $module_loaded = false;
+ public $query_string;
+ public $config;
+ public $page;
+ public $profile;
+ public $user;
+ public $cid;
+ public $contact;
+ public $contacts;
+ public $page_contact;
+ public $content;
+ public $data = array();
+ public $error = false;
+ public $cmd;
+ public $argv;
+ public $argc;
+ public $module;
+ public $pager;
+ public $strings;
+ public $path;
+ public $hooks;
+ public $timezone;
+ public $interactive = true;
+ public $plugins;
+ public $apps = array();
+ public $identities;
- public $nav_sel;
+ public $nav_sel;
- public $category;
+ public $category;
- private $scheme;
- private $hostname;
- private $baseurl;
- private $db;
+ private $scheme;
+ private $hostname;
+ private $baseurl;
+ private $db;
- private $curl_code;
- private $curl_headers;
+ private $curl_code;
+ private $curl_headers;
- function __construct() {
+ function __construct() {
- $this->config = array();
- $this->page = array();
- $this->pager= array();
+ $this->config = array();
+ $this->page = array();
+ $this->pager= array();
- $this->query_string = '';
+ $this->query_string = '';
- startup();
+ startup();
- $this->scheme = 'http';
- if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS'])
- $this->scheme = 'https';
- elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
+ $this->scheme = 'http';
+ if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS'])
+ $this->scheme = 'https';
+ elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
$this->scheme = 'https';
- if(x($_SERVER,'SERVER_NAME')) {
- $this->hostname = $_SERVER['SERVER_NAME'];
- if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443)
- $this->hostname .= ':' . $_SERVER['SERVER_PORT'];
- /**
- * Figure out if we are running at the top of a domain
- * or in a sub-directory and adjust accordingly
+ if(x($_SERVER,'SERVER_NAME')) {
+ $this->hostname = $_SERVER['SERVER_NAME'];
+ if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443)
+ $this->hostname .= ':' . $_SERVER['SERVER_PORT'];
+ /**
+ * Figure out if we are running at the top of a domain
+ * or in a sub-directory and adjust accordingly
+ */
+
+ $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/\\');
+ if(isset($path) && strlen($path) && ($path != $this->path))
+ $this->path = $path;
+ }
+
+ set_include_path(
+ "include/$this->hostname" . PATH_SEPARATOR
+ . 'include' . PATH_SEPARATOR
+ . 'library' . PATH_SEPARATOR
+ . 'library/phpsec' . PATH_SEPARATOR
+ . '.' );
+
+ if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
+ $this->query_string = substr($_SERVER['QUERY_STRING'],2);
+ // removing trailing / - maybe a nginx problem
+ if (substr($this->query_string, 0, 1) == "/")
+ $this->query_string = substr($this->query_string, 1);
+ }
+ if(x($_GET,'q'))
+ $this->cmd = trim($_GET['q'],'/\\');
+
+ // unix style "homedir"
+
+ if(substr($this->cmd,0,1) === '~')
+ $this->cmd = 'profile/' . substr($this->cmd,1);
+
+ // Diaspora style profile url
+
+ if(substr($this->cmd,0,2) === 'u/')
+ $this->cmd = 'profile/' . substr($this->cmd,2);
+
+ /**
+ *
+ * Break the URL path into C style argc/argv style arguments for our
+ * modules. Given "http://example.com/module/arg1/arg2", $this->argc
+ * will be 3 (integer) and $this->argv will contain:
+ * [0] => 'module'
+ * [1] => 'arg1'
+ * [2] => 'arg2'
+ *
+ *
+ * There will always be one argument. If provided a naked domain
+ * URL, $this->argv[0] is set to "home".
+ *
*/
- $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/\\');
- if(isset($path) && strlen($path) && ($path != $this->path))
- $this->path = $path;
- }
-
- set_include_path(
- "include/$this->hostname" . PATH_SEPARATOR
- . 'include' . PATH_SEPARATOR
- . 'library' . PATH_SEPARATOR
- . 'library/phpsec' . PATH_SEPARATOR
- . '.' );
-
- if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
- $this->query_string = substr($_SERVER['QUERY_STRING'],2);
- // removing trailing / - maybe a nginx problem
- if (substr($this->query_string, 0, 1) == "/")
- $this->query_string = substr($this->query_string, 1);
- }
- if(x($_GET,'q'))
- $this->cmd = trim($_GET['q'],'/\\');
-
- // unix style "homedir"
-
- if(substr($this->cmd,0,1) === '~')
- $this->cmd = 'profile/' . substr($this->cmd,1);
-
- // Diaspora style profile url
-
- if(substr($this->cmd,0,2) === 'u/')
- $this->cmd = 'profile/' . substr($this->cmd,2);
-
- /**
- *
- * Break the URL path into C style argc/argv style arguments for our
- * modules. Given "http://example.com/module/arg1/arg2", $this->argc
- * will be 3 (integer) and $this->argv will contain:
- * [0] => 'module'
- * [1] => 'arg1'
- * [2] => 'arg2'
- *
- *
- * There will always be one argument. If provided a naked domain
- * URL, $this->argv[0] is set to "home".
- *
- */
-
- $this->argv = explode('/',$this->cmd);
- $this->argc = count($this->argv);
- if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) {
- $this->module = str_replace(".", "_", $this->argv[0]);
- if(array_key_exists('2',$this->argv)) {
- $this->category = $this->argv[2];
+ $this->argv = explode('/',$this->cmd);
+ $this->argc = count($this->argv);
+ if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) {
+ $this->module = str_replace(".", "_", $this->argv[0]);
+ if(array_key_exists('2',$this->argv)) {
+ $this->category = $this->argv[2];
+ }
}
- }
- else {
- $this->argc = 1;
- $this->argv = array('home');
- $this->module = 'home';
+ else {
+ $this->argc = 1;
+ $this->argv = array('home');
+ $this->module = 'home';
+ }
+
+ /**
+ * Special handling for the webfinger/lrdd host XRD file
+ */
+
+ if($this->cmd === '.well-known/host-meta') {
+ $this->argc = 1;
+ $this->argv = array('hostxrd');
+ $this->module = 'hostxrd';
+ }
+
+ /**
+ * See if there is any page number information, and initialise
+ * pagination
+ */
+
+ $this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
+ $this->pager['itemspage'] = 50;
+ $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
+ $this->pager['total'] = 0;
}
- /**
- * Special handling for the webfinger/lrdd host XRD file
- */
+ function get_baseurl($ssl = false) {
- if($this->cmd === '.well-known/host-meta') {
- $this->argc = 1;
- $this->argv = array('hostxrd');
- $this->module = 'hostxrd';
+ $scheme = $this->scheme;
+
+ if((x($this->config,'system')) && (x($this->config['system'],'ssl_policy'))) {
+ if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL))
+ $scheme = 'https';
+
+ // We need to populate the $ssl flag across the entire program before turning this on.
+ // Basically, we'll have $ssl = true on any links which can only be seen by a logged in user
+ // (and also the login link). Anything seen by an outsider will have it turned off.
+ // At present, setting SSL_POLICY_SELFSIGN will only force remote contacts to update their
+ // contact links to this site with "http:" if they are currently using "https:"
+
+ // if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) {
+ // if($ssl)
+ // $scheme = 'https';
+ // else
+ // $scheme = 'http';
+ // }
}
- /**
- * See if there is any page number information, and initialise
- * pagination
- */
-
- $this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
- $this->pager['itemspage'] = 50;
- $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
- $this->pager['total'] = 0;
- }
-
- function get_baseurl($ssl = false) {
-
- $scheme = $this->scheme;
-
- if((x($this->config,'system')) && (x($this->config['system'],'ssl_policy'))) {
- if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL))
- $scheme = 'https';
-
-// We need to populate the $ssl flag across the entire program before turning this on.
-// Basically, we'll have $ssl = true on any links which can only be seen by a logged in user
-// (and also the login link). Anything seen by an outsider will have it turned off.
-// At present, setting SSL_POLICY_SELFSIGN will only force remote contacts to update their
-// contact links to this site with "http:" if they are currently using "https:"
-
-// if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) {
-// if($ssl)
-// $scheme = 'https';
-// else
-// $scheme = 'http';
-// }
+ $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
+ return $this->baseurl;
}
- $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
- return $this->baseurl;
- }
+ function set_baseurl($url) {
+ $parsed = @parse_url($url);
- function set_baseurl($url) {
- $parsed = @parse_url($url);
+ $this->baseurl = $url;
- $this->baseurl = $url;
+ if($parsed) {
+ $this->scheme = $parsed['scheme'];
- if($parsed) {
- $this->scheme = $parsed['scheme'];
+ $this->hostname = $parsed['host'];
+ if(x($parsed,'port'))
+ $this->hostname .= ':' . $parsed['port'];
+ if(x($parsed,'path'))
+ $this->path = trim($parsed['path'],'\\/');
+ }
- $this->hostname = $parsed['host'];
- if(x($parsed,'port'))
- $this->hostname .= ':' . $parsed['port'];
- if(x($parsed,'path'))
- $this->path = trim($parsed['path'],'\\/');
}
+ function get_hostname() {
+ return $this->hostname;
+ }
+
+ function set_hostname($h) {
+ $this->hostname = $h;
+ }
+
+ function set_path($p) {
+ $this->path = trim(trim($p),'/');
+ }
+
+ function get_path() {
+ return $this->path;
+ }
+
+ function set_pager_total($n) {
+ $this->pager['total'] = intval($n);
+ }
+
+ function set_pager_itemspage($n) {
+ $this->pager['itemspage'] = intval($n);
+ $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
+
+ }
+
+ function init_pagehead() {
+ $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
+ if($interval < 10000)
+ $interval = 40000;
+
+ $this->page['title'] = $this->config['sitename'];
+ $tpl = file_get_contents('view/head.tpl');
+ $this->page['htmlhead'] = replace_macros($tpl,array(
+ '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
+ '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
+ '$delitem' => t('Delete this item?'),
+ '$comment' => t('Comment'),
+ '$showmore' => t('show more'),
+ '$showfewer' => t('show fewer'),
+ '$update_interval' => $interval
+ ));
+ }
+
+ function set_curl_code($code) {
+ $this->curl_code = $code;
+ }
+
+ function get_curl_code() {
+ return $this->curl_code;
+ }
+
+ function set_curl_headers($headers) {
+ $this->curl_headers = $headers;
+ }
+
+ function get_curl_headers() {
+ return $this->curl_headers;
+ }
+
+
}
-
- function get_hostname() {
- return $this->hostname;
- }
-
- function set_hostname($h) {
- $this->hostname = $h;
- }
-
- function set_path($p) {
- $this->path = trim(trim($p),'/');
- }
-
- function get_path() {
- return $this->path;
- }
-
- function set_pager_total($n) {
- $this->pager['total'] = intval($n);
- }
-
- function set_pager_itemspage($n) {
- $this->pager['itemspage'] = intval($n);
- $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
-
- }
-
- function init_pagehead() {
- $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
- if($interval < 10000)
- $interval = 40000;
-
- $this->page['title'] = $this->config['sitename'];
- $tpl = file_get_contents('view/head.tpl');
- $this->page['htmlhead'] = replace_macros($tpl,array(
- '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
- '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
- '$delitem' => t('Delete this item?'),
- '$comment' => t('Comment'),
- '$showmore' => t('show more'),
- '$showfewer' => t('show fewer'),
- '$update_interval' => $interval
- ));
- }
-
- function set_curl_code($code) {
- $this->curl_code = $code;
- }
-
- function get_curl_code() {
- return $this->curl_code;
- }
-
- function set_curl_headers($headers) {
- $this->curl_headers = $headers;
- }
-
- function get_curl_headers() {
- return $this->curl_headers;
- }
-
-
-}}
+}
// retrieve the App structure
// useful in functions which require it but don't get it passed to them
if(! function_exists('get_app')) {
-function get_app() {
- global $a;
- return $a;
-}};
+ function get_app() {
+ global $a;
+ return $a;
+ }
+};
// Multi-purpose function to check variable state.
@@ -534,42 +537,44 @@ function get_app() {
// e.g. x('') or x(0) returns 0;
if(! function_exists('x')) {
-function x($s,$k = NULL) {
- if($k != NULL) {
- if((is_array($s)) && (array_key_exists($k,$s))) {
- if($s[$k])
- return (int) 1;
- return (int) 0;
+ function x($s,$k = NULL) {
+ if($k != NULL) {
+ if((is_array($s)) && (array_key_exists($k,$s))) {
+ if($s[$k])
+ return (int) 1;
+ return (int) 0;
}
- return false;
- }
- else {
- if(isset($s)) {
- if($s) {
- return (int) 1;
+ return false;
+ }
+ else {
+ if(isset($s)) {
+ if($s) {
+ return (int) 1;
+ }
+ return (int) 0;
}
- return (int) 0;
+ return false;
}
- return false;
}
-}}
+}
// called from db initialisation if db is dead.
if(! function_exists('system_unavailable')) {
-function system_unavailable() {
- include('system_unavailable.php');
- system_down();
- killme();
-}}
+ function system_unavailable() {
+ include('system_unavailable.php');
+ system_down();
+ killme();
+ }
+}
function clean_urls() {
global $a;
-// if($a->config['system']['clean_urls'])
- return true;
-// return false;
+ // if($a->config['system']['clean_urls'])
+ return true;
+ // return false;
}
function z_path() {
@@ -596,125 +601,150 @@ function is_ajax() {
}
-// Primarily involved with database upgrade, but also sets the
+// Primarily involved with database upgrade, but also sets the
// base url for use in cmdline programs which don't have
// $_SERVER variables, and synchronising the state of installed plugins.
if(! function_exists('check_config')) {
-function check_config(&$a) {
+ function check_config(&$a) {
- $build = get_config('system','build');
- if(! x($build))
- $build = set_config('system','build',DB_UPDATE_VERSION);
+ $build = get_config('system','build');
+ if(! x($build))
+ $build = set_config('system','build',DB_UPDATE_VERSION);
- $url = get_config('system','url');
+ $url = get_config('system','url');
- // if the url isn't set or the stored url is radically different
- // than the currently visited url, store the current value accordingly.
- // "Radically different" ignores common variations such as http vs https
- // and www.example.com vs example.com.
+ // if the url isn't set or the stored url is radically different
+ // than the currently visited url, store the current value accordingly.
+ // "Radically different" ignores common variations such as http vs https
+ // and www.example.com vs example.com.
- if((! x($url)) || (! link_compare($url,$a->get_baseurl())))
- $url = set_config('system','url',$a->get_baseurl());
+ if((! x($url)) || (! link_compare($url,$a->get_baseurl())))
+ $url = set_config('system','url',$a->get_baseurl());
- if($build != DB_UPDATE_VERSION) {
- $stored = intval($build);
- $current = intval(DB_UPDATE_VERSION);
- if(($stored < $current) && file_exists('update.php')) {
+ if($build != DB_UPDATE_VERSION) {
+ $stored = intval($build);
+ $current = intval(DB_UPDATE_VERSION);
+ if(($stored < $current) && file_exists('update.php')) {
- load_config('database');
+ load_config('database');
- // We're reporting a different version than what is currently installed.
- // Run any existing update scripts to bring the database up to current.
+ // We're reporting a different version than what is currently installed.
+ // Run any existing update scripts to bring the database up to current.
- require_once('update.php');
+ require_once('update.php');
- // make sure that boot.php and update.php are the same release, we might be
- // updating right this very second and the correct version of the update.php
- // file may not be here yet. This can happen on a very busy site.
+ // make sure that boot.php and update.php are the same release, we might be
+ // updating right this very second and the correct version of the update.php
+ // file may not be here yet. This can happen on a very busy site.
- if(DB_UPDATE_VERSION == UPDATE_VERSION) {
+ if(DB_UPDATE_VERSION == UPDATE_VERSION) {
- for($x = $stored; $x < $current; $x ++) {
- if(function_exists('update_' . $x)) {
+ for($x = $stored; $x < $current; $x ++) {
+ if(function_exists('update_' . $x)) {
- // There could be a lot of processes running or about to run.
- // We want exactly one process to run the update command.
- // So store the fact that we're taking responsibility
- // after first checking to see if somebody else already has.
+ // There could be a lot of processes running or about to run.
+ // We want exactly one process to run the update command.
+ // So store the fact that we're taking responsibility
+ // after first checking to see if somebody else already has.
- // If the update fails or times-out completely you may need to
- // delete the config entry to try again.
+ // If the update fails or times-out completely you may need to
+ // delete the config entry to try again.
- if(get_config('database','update_' . $x))
- break;
- set_config('database','update_' . $x, '1');
+ if(get_config('database','update_' . $x))
+ break;
+ set_config('database','update_' . $x, '1');
- // call the specific update
+ // call the specific update
- $func = 'update_' . $x;
- $func($a);
+// global $db;
+// $db->excep(TRUE);
+// try {
+// $db->beginTransaction();
+ $func = 'update_' . $x;
+ $func($a);
+// $db->commit();
+// } catch(Exception $ex) {
+// $db->rollback();
+// //send the administrator an e-mail
+// $email_tpl = get_intltext_template("update_fail_eml.tpl");
+// $email_tpl = replace_macros($email_tpl, array(
+// '$sitename' => $a->config['sitename'],
+// '$siteurl' => $a->get_baseurl(),
+// '$update' => $x,
+// '$error' => $ex->getMessage()));
+// $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
+
+// mail($a->config['admin_email'], $subject, $text,
+// 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+// . 'Content-type: text/plain; charset=UTF-8' . "\n"
+// . 'Content-transfer-encoding: 8bit' );
+// //try the logger
+// logger('update failed: '.$ex->getMessage().EOL);
+// }
+// $db->excep(FALSE);
+ }
}
+ set_config('system','build', DB_UPDATE_VERSION);
}
- set_config('system','build', DB_UPDATE_VERSION);
}
}
- }
- /**
- *
- * Synchronise plugins:
- *
- * $a->config['system']['addon'] contains a comma-separated list of names
- * of plugins/addons which are used on this system.
- * Go through the database list of already installed addons, and if we have
- * an entry, but it isn't in the config list, call the uninstall procedure
- * and mark it uninstalled in the database (for now we'll remove it).
- * Then go through the config list and if we have a plugin that isn't installed,
- * call the install procedure and add it to the database.
- *
- */
+ /**
+ *
+ * Synchronise plugins:
+ *
+ * $a->config['system']['addon'] contains a comma-separated list of names
+ * of plugins/addons which are used on this system.
+ * Go through the database list of already installed addons, and if we have
+ * an entry, but it isn't in the config list, call the uninstall procedure
+ * and mark it uninstalled in the database (for now we'll remove it).
+ * Then go through the config list and if we have a plugin that isn't installed,
+ * call the install procedure and add it to the database.
+ *
+ */
- $r = q("SELECT * FROM `addon` WHERE `installed` = 1");
- if(count($r))
- $installed = $r;
- else
- $installed = array();
+ $r = q("SELECT * FROM `addon` WHERE `installed` = 1");
+ if(count($r))
+ $installed = $r;
+ else
+ $installed = array();
- $plugins = get_config('system','addon');
- $plugins_arr = array();
+ $plugins = get_config('system','addon');
+ $plugins_arr = array();
- if($plugins)
- $plugins_arr = explode(',',str_replace(' ', '',$plugins));
+ if($plugins)
+ $plugins_arr = explode(',',str_replace(' ', '',$plugins));
- $a->plugins = $plugins_arr;
+ $a->plugins = $plugins_arr;
- $installed_arr = array();
+ $installed_arr = array();
- if(count($installed)) {
- foreach($installed as $i) {
- if(! in_array($i['name'],$plugins_arr)) {
- uninstall_plugin($i['name']);
+ if(count($installed)) {
+ foreach($installed as $i) {
+ if(! in_array($i['name'],$plugins_arr)) {
+ uninstall_plugin($i['name']);
}
- else
- $installed_arr[] = $i['name'];
- }
- }
-
- if(count($plugins_arr)) {
- foreach($plugins_arr as $p) {
- if(! in_array($p,$installed_arr)) {
- install_plugin($p);
+ else
+ $installed_arr[] = $i['name'];
}
}
+
+ if(count($plugins_arr)) {
+ foreach($plugins_arr as $p) {
+ if(! in_array($p,$installed_arr)) {
+ install_plugin($p);
+ }
+ }
+ }
+
+
+ load_hooks();
+
+ return;
}
-
-
- load_hooks();
-
- return;
-}}
+}
function get_guid($size=16) {
@@ -735,116 +765,124 @@ function get_guid($size=16) {
// returns the complete html for inserting into the page
if(! function_exists('login')) {
-function login($register = false, $hiddens=false) {
- $a = get_app();
- $o = "";
- $reg = false;
- if ($register) {
- $reg = array(
- 'title' => t('Create a New Account'),
- 'desc' => t('Register')
- );
- }
+ function login($register = false, $hiddens=false) {
+ $a = get_app();
+ $o = "";
+ $reg = false;
+ if ($register) {
+ $reg = array(
+ 'title' => t('Create a New Account'),
+ 'desc' => t('Register')
+ );
+ }
- $noid = get_config('system','no_openid');
+ $noid = get_config('system','no_openid');
- $dest_url = $a->get_baseurl(true) . '/' . $a->query_string;
+ $dest_url = $a->get_baseurl(true) . '/' . $a->query_string;
- if(local_user()) {
- $tpl = get_markup_template("logout.tpl");
- }
- else {
- $tpl = get_markup_template("login.tpl");
- $_SESSION['return_url'] = $a->query_string;
+ if(local_user()) {
+ $tpl = get_markup_template("logout.tpl");
+ }
+ else {
+ $tpl = get_markup_template("login.tpl");
+ $_SESSION['return_url'] = $a->query_string;
+ }
+
+
+ $o .= replace_macros($tpl,array(
+
+ '$dest_url' => $dest_url,
+ '$logout' => t('Logout'),
+ '$login' => t('Login'),
+
+ '$lname' => array('username', t('Nickname or Email address: ') , '', ''),
+ '$lpassword' => array('password', t('Password: '), '', ''),
+
+ '$openid' => !$noid,
+ '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''),
+
+ '$hiddens' => $hiddens,
+
+ '$register' => $reg,
+
+ '$lostpass' => t('Forgot your password?'),
+ '$lostlink' => t('Password Reset'),
+ ));
+
+ call_hooks('login_hook',$o);
+
+ return $o;
}
+}
-
- $o .= replace_macros($tpl,array(
-
- '$dest_url' => $dest_url,
- '$logout' => t('Logout'),
- '$login' => t('Login'),
-
- '$lname' => array('username', t('Nickname or Email address: ') , '', ''),
- '$lpassword' => array('password', t('Password: '), '', ''),
-
- '$openid' => !$noid,
- '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''),
-
- '$hiddens' => $hiddens,
-
- '$register' => $reg,
-
- '$lostpass' => t('Forgot your password?'),
- '$lostlink' => t('Password Reset'),
- ));
-
- call_hooks('login_hook',$o);
-
- return $o;
-}}
-
-// Used to end the current process, after saving session state.
+// Used to end the current process, after saving session state.
if(! function_exists('killme')) {
-function killme() {
- session_write_close();
- exit;
-}}
+ function killme() {
+ session_write_close();
+ exit;
+ }
+}
// redirect to another URL and terminate this process.
if(! function_exists('goaway')) {
-function goaway($s) {
- header("Location: $s");
- killme();
-}}
+ function goaway($s) {
+ header("Location: $s");
+ killme();
+ }
+}
// Returns the uid of locally logged in user or false.
if(! function_exists('local_user')) {
-function local_user() {
- if((x($_SESSION,'authenticated')) && (x($_SESSION,'uid')))
- return intval($_SESSION['uid']);
- return false;
-}}
+ function local_user() {
+ if((x($_SESSION,'authenticated')) && (x($_SESSION,'uid')))
+ return intval($_SESSION['uid']);
+ return false;
+ }
+}
// Returns contact id of authenticated site visitor or false
if(! function_exists('remote_user')) {
-function remote_user() {
- if((x($_SESSION,'authenticated')) && (x($_SESSION,'visitor_id')))
- return intval($_SESSION['visitor_id']);
- return false;
-}}
+ function remote_user() {
+ if((x($_SESSION,'authenticated')) && (x($_SESSION,'visitor_id')))
+ return intval($_SESSION['visitor_id']);
+ return false;
+ }
+}
// contents of $s are displayed prominently on the page the next time
// a page is loaded. Usually used for errors or alerts.
if(! function_exists('notice')) {
-function notice($s) {
- $a = get_app();
- if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array();
- if($a->interactive)
- $_SESSION['sysmsg'][] = $s;
-}}
+ function notice($s) {
+ $a = get_app();
+ if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array();
+ if($a->interactive)
+ $_SESSION['sysmsg'][] = $s;
+ }
+}
if(! function_exists('info')) {
-function info($s) {
- $a = get_app();
- if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
- if($a->interactive)
- $_SESSION['sysmsg_info'][] = $s;
-}}
+ function info($s) {
+ $a = get_app();
+ if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
+ if($a->interactive)
+ $_SESSION['sysmsg_info'][] = $s;
+ }
+}
// wrapper around config to limit the text length of an incoming message
if(! function_exists('get_max_import_size')) {
-function get_max_import_size() {
- global $a;
- return ((x($a->config,'max_import_size')) ? $a->config['max_import_size'] : 0 );
-}}
+ function get_max_import_size() {
+ global $a;
+ return ((x($a->config,'max_import_size')) ? $a->config['max_import_size'] : 0 );
+ }
+}
@@ -855,7 +893,7 @@ function get_max_import_size() {
* @parameter string $nickname
* @parameter int $profile
*
- * Summary: Loads a profile into the page sidebar.
+ * Summary: Loads a profile into the page sidebar.
* The function requires a writeable copy of the main App structure, and the nickname
* of a registered local account.
*
@@ -865,88 +903,89 @@ function get_max_import_size() {
* by the owner.
*
* Profile information is placed in the App structure for later retrieval.
- * Honours the owner's chosen theme for display.
+ * Honours the owner's chosen theme for display.
*
*/
if(! function_exists('profile_load')) {
-function profile_load(&$a, $nickname, $profile = 0) {
- if(remote_user()) {
- $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1",
- intval($_SESSION['visitor_id']));
- if(count($r))
- $profile = $r[0]['profile-id'];
- }
+ function profile_load(&$a, $nickname, $profile = 0) {
+ if(remote_user()) {
+ $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1",
+ intval($_SESSION['visitor_id']));
+ if(count($r))
+ $profile = $r[0]['profile-id'];
+ }
- $r = null;
+ $r = null;
- if($profile) {
- $profile_int = intval($profile);
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
- left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1",
- dbesc($nickname),
- intval($profile_int)
- );
- }
- if((! $r) && (! count($r))) {
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
- left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
- dbesc($nickname)
- );
- }
+ if($profile) {
+ $profile_int = intval($profile);
+ $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+ left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1",
+ dbesc($nickname),
+ intval($profile_int)
+ );
+ }
+ if((! $r) && (! count($r))) {
+ $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+ left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
+ dbesc($nickname)
+ );
+ }
+
+ if(($r === false) || (! count($r))) {
+ notice( t('Requested profile is not available.') . EOL );
+ $a->error = 404;
+ return;
+ }
+
+ // fetch user tags if this isn't the default profile
+
+ if(! $r[0]['is-default']) {
+ $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
+ intval($profile_uid)
+ );
+ if($x && count($x))
+ $r[0]['pub_keywords'] = $x[0]['pub_keywords'];
+ }
+
+ $a->profile = $r[0];
+
+
+ $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
+ $_SESSION['theme'] = $a->profile['theme'];
+
+ /**
+ * load/reload current theme info
+ */
+
+ $theme_info_file = "view/theme/".current_theme()."/theme.php";
+ if (file_exists($theme_info_file)){
+ require_once($theme_info_file);
+ }
+
+ if(! (x($a->page,'aside')))
+ $a->page['aside'] = '';
+
+ if(local_user() && local_user() == $a->profile['uid']) {
+ $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array(
+ '$editprofile' => t('Edit profile'),
+ '$profid' => $a->profile['id']
+ ));
+ }
+
+ $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
+
+ $a->page['aside'] .= profile_sidebar($a->profile, $block);
+
+ /*if(! $block)
+ $a->page['aside'] .= contact_block();*/
- if(($r === false) || (! count($r))) {
- notice( t('Requested profile is not available.') . EOL );
- $a->error = 404;
return;
}
-
- // fetch user tags if this isn't the default profile
-
- if(! $r[0]['is-default']) {
- $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
- intval($profile_uid)
- );
- if($x && count($x))
- $r[0]['pub_keywords'] = $x[0]['pub_keywords'];
- }
-
- $a->profile = $r[0];
-
-
- $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
- $_SESSION['theme'] = $a->profile['theme'];
-
- /**
- * load/reload current theme info
- */
-
- $theme_info_file = "view/theme/".current_theme()."/theme.php";
- if (file_exists($theme_info_file)){
- require_once($theme_info_file);
- }
-
- if(! (x($a->page,'aside')))
- $a->page['aside'] = '';
-
- if(local_user() && local_user() == $a->profile['uid']) {
- $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array(
- '$editprofile' => t('Edit profile'),
- '$profid' => $a->profile['id']
- ));
- }
-
- $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
-
- $a->page['aside'] .= profile_sidebar($a->profile, $block);
-
- /*if(! $block)
- $a->page['aside'] .= contact_block();*/
-
- return;
-}}
+}
/**
@@ -966,478 +1005,488 @@ function profile_load(&$a, $nickname, $profile = 0) {
if(! function_exists('profile_sidebar')) {
-function profile_sidebar($profile, $block = 0) {
+ function profile_sidebar($profile, $block = 0) {
- $a = get_app();
+ $a = get_app();
- $o = '';
- $location = false;
- $address = false;
- $pdesc = true;
+ $o = '';
+ $location = false;
+ $address = false;
+ $pdesc = true;
- if((! is_array($profile)) && (! count($profile)))
- return $o;
+ if((! is_array($profile)) && (! count($profile)))
+ return $o;
- $profile['picdate'] = urlencode($profile['picdate']);
+ $profile['picdate'] = urlencode($profile['picdate']);
- call_hooks('profile_sidebar_enter', $profile);
+ call_hooks('profile_sidebar_enter', $profile);
- // don't show connect link to yourself
- $connect = (($profile['uid'] != local_user()) ? t('Connect') : False);
+ // don't show connect link to yourself
+ $connect = (($profile['uid'] != local_user()) ? t('Connect') : False);
- // don't show connect link to authenticated visitors either
+ // don't show connect link to authenticated visitors either
- if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
- $connect = False;
+ if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
+ $connect = False;
- if(get_my_url() && $profile['unkmail'])
- $wallmessage = t('Message');
- else
- $wallmessage = false;
+ if(get_my_url() && $profile['unkmail'])
+ $wallmessage = t('Message');
+ else
+ $wallmessage = false;
- // show edit profile to yourself
- if ($profile['uid'] == local_user()) {
- $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
+ // show edit profile to yourself
+ if ($profile['uid'] == local_user()) {
+ $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
- $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
- local_user());
+ $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
+ local_user());
- $profile['menu'] = array(
- 'chg_photo' => t('Change profile photo'),
- 'cr_new' => t('Create New Profile'),
- 'entries' => array(),
- );
-
- if(count($r)) {
+ $profile['menu'] = array(
+ 'chg_photo' => t('Change profile photo'),
+ 'cr_new' => t('Create New Profile'),
+ 'entries' => array(),
+ );
+
+ if(count($r)) {
+
+ foreach($r as $rr) {
+ $profile['menu']['entries'][] = array(
+ 'photo' => $rr['thumb'],
+ 'id' => $rr['id'],
+ 'alt' => t('Profile Image'),
+ 'profile_name' => $rr['profile-name'],
+ 'isdefault' => $rr['is-default'],
+ 'visibile_to_everybody' => t('visible to everybody'),
+ 'edit_visibility' => t('Edit visibility'),
+
+ );
+ }
+
- foreach($r as $rr) {
- $profile['menu']['entries'][] = array(
- 'photo' => $rr['thumb'],
- 'id' => $rr['id'],
- 'alt' => t('Profile Image'),
- 'profile_name' => $rr['profile-name'],
- 'isdefault' => $rr['is-default'],
- 'visibile_to_everybody' => t('visible to everybody'),
- 'edit_visibility' => t('Edit visibility'),
-
- );
}
}
-
-
- }
- if((x($profile,'address') == 1)
- || (x($profile,'locality') == 1)
- || (x($profile,'region') == 1)
- || (x($profile,'postal-code') == 1)
- || (x($profile,'country-name') == 1))
- $location = t('Location:');
+ if((x($profile,'address') == 1)
+ || (x($profile,'locality') == 1)
+ || (x($profile,'region') == 1)
+ || (x($profile,'postal-code') == 1)
+ || (x($profile,'country-name') == 1))
+ $location = t('Location:');
- $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
+ $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
- $marital = ((x($profile,'marital') == 1) ? t('Status:') : False);
+ $marital = ((x($profile,'marital') == 1) ? t('Status:') : False);
- $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
+ $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
- if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
- $location = $pdesc = $gender = $marital = $homepage = False;
+ if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
+ $location = $pdesc = $gender = $marital = $homepage = False;
+ }
+
+ $firstname = ((strpos($profile['name'],' '))
+ ? trim(substr($profile['name'],0,strpos($profile['name'],' '))) : $profile['name']);
+ $lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'],strlen($firstname))));
+
+ $diaspora = array(
+ 'podloc' => $a->get_baseurl(),
+ 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
+ 'nickname' => $profile['nickname'],
+ 'fullname' => $profile['name'],
+ 'firstname' => $firstname,
+ 'lastname' => $lastname,
+ 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
+ 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
+ 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
+ );
+
+ if (!$block){
+ $contact_block = contact_block();
+ }
+
+
+ $tpl = get_markup_template('profile_vcard.tpl');
+
+ $o .= replace_macros($tpl, array(
+ '$profile' => $profile,
+ '$connect' => $connect,
+ '$wallmessage' => $wallmessage,
+ '$location' => template_escape($location),
+ '$gender' => $gender,
+ '$pdesc' => $pdesc,
+ '$marital' => $marital,
+ '$homepage' => $homepage,
+ '$diaspora' => $diaspora,
+ '$contact_block' => $contact_block,
+ ));
+
+
+ $arr = array('profile' => &$profile, 'entry' => &$o);
+
+ call_hooks('profile_sidebar', $arr);
+
+ return $o;
}
-
- $firstname = ((strpos($profile['name'],' '))
- ? trim(substr($profile['name'],0,strpos($profile['name'],' '))) : $profile['name']);
- $lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'],strlen($firstname))));
-
- $diaspora = array(
- 'podloc' => $a->get_baseurl(),
- 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
- 'nickname' => $profile['nickname'],
- 'fullname' => $profile['name'],
- 'firstname' => $firstname,
- 'lastname' => $lastname,
- 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
- 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
- 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
- );
-
- if (!$block){
- $contact_block = contact_block();
- }
-
-
- $tpl = get_markup_template('profile_vcard.tpl');
-
- $o .= replace_macros($tpl, array(
- '$profile' => $profile,
- '$connect' => $connect,
- '$wallmessage' => $wallmessage,
- '$location' => template_escape($location),
- '$gender' => $gender,
- '$pdesc' => $pdesc,
- '$marital' => $marital,
- '$homepage' => $homepage,
- '$diaspora' => $diaspora,
- '$contact_block' => $contact_block,
- ));
-
-
- $arr = array('profile' => &$profile, 'entry' => &$o);
-
- call_hooks('profile_sidebar', $arr);
-
- return $o;
-}}
+}
if(! function_exists('get_birthdays')) {
-function get_birthdays() {
+ function get_birthdays() {
- $a = get_app();
- $o = '';
+ $a = get_app();
+ $o = '';
- if(! local_user())
- return $o;
+ if(! local_user())
+ return $o;
- $bd_format = t('g A l F d') ; // 8 AM Friday January 18
- $bd_short = t('F d');
+ $bd_format = t('g A l F d') ; // 8 AM Friday January 18
+ $bd_short = t('F d');
- $r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
- LEFT JOIN `contact` ON `contact`.`id` = `event`.`cid`
- WHERE `event`.`uid` = %d AND `type` = 'birthday' AND `start` < '%s' AND `finish` > '%s'
- ORDER BY `start` ASC ",
- intval(local_user()),
- dbesc(datetime_convert('UTC','UTC','now + 6 days')),
- dbesc(datetime_convert('UTC','UTC','now'))
- );
+ $r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
+ LEFT JOIN `contact` ON `contact`.`id` = `event`.`cid`
+ WHERE `event`.`uid` = %d AND `type` = 'birthday' AND `start` < '%s' AND `finish` > '%s'
+ ORDER BY `start` ASC ",
+ intval(local_user()),
+ dbesc(datetime_convert('UTC','UTC','now + 6 days')),
+ dbesc(datetime_convert('UTC','UTC','now'))
+ );
- if($r && count($r)) {
- $total = 0;
- $now = strtotime('now');
- $cids = array();
+ if($r && count($r)) {
+ $total = 0;
+ $now = strtotime('now');
+ $cids = array();
- $istoday = false;
- foreach($r as $rr) {
- if(strlen($rr['name']))
- $total ++;
+ $istoday = false;
+ foreach($r as $rr) {
+ if(strlen($rr['name']))
+ $total ++;
if((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now))
$istoday = true;
+ }
+ $classtoday = $istoday ? ' birthday-today ' : '';
+ if($total) {
+ $o .= '
"; var_dump($a->user); killme(); + function profile_tabs($a, $is_owner=False, $nickname=Null){ + //echo ""; var_dump($a->user); killme(); - if (is_null($nickname)) - $nickname = $a->user['nickname']; + if (is_null($nickname)) + $nickname = $a->user['nickname']; - if(x($_GET,'tab')) - $tab = notags(trim($_GET['tab'])); + if(x($_GET,'tab')) + $tab = notags(trim($_GET['tab'])); - $url = $a->get_baseurl() . '/profile/' . $nickname; + $url = $a->get_baseurl() . '/profile/' . $nickname; - $tabs = array( - array( - 'label'=>t('Status'), - 'url' => $url, - 'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''), - ), - array( - 'label' => t('Profile'), - 'url' => $url.'/?tab=profile', - 'sel' => ((isset($tab) && $tab=='profile')?'active':''), - ), - array( - 'label' => t('Photos'), - 'url' => $a->get_baseurl() . '/photos/' . $nickname, - 'sel' => ((!isset($tab)&&$a->argv[0]=='photos')?'active':''), - ), - ); + $tabs = array( + array( + 'label'=>t('Status'), + 'url' => $url, + 'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''), + ), + array( + 'label' => t('Profile'), + 'url' => $url.'/?tab=profile', + 'sel' => ((isset($tab) && $tab=='profile')?'active':''), + ), + array( + 'label' => t('Photos'), + 'url' => $a->get_baseurl() . '/photos/' . $nickname, + 'sel' => ((!isset($tab)&&$a->argv[0]=='photos')?'active':''), + ), + ); - if ($is_owner){ - $tabs[] = array( - 'label' => t('Events'), - 'url' => $a->get_baseurl() . '/events', - 'sel' =>((!isset($tab)&&$a->argv[0]=='events')?'active':''), - ); - $tabs[] = array( - 'label' => t('Personal Notes'), - 'url' => $a->get_baseurl() . '/notes', - 'sel' =>((!isset($tab)&&$a->argv[0]=='notes')?'active':''), - ); + if ($is_owner){ + $tabs[] = array( + 'label' => t('Events'), + 'url' => $a->get_baseurl() . '/events', + 'sel' =>((!isset($tab)&&$a->argv[0]=='events')?'active':''), + ); + $tabs[] = array( + 'label' => t('Personal Notes'), + 'url' => $a->get_baseurl() . '/notes', + 'sel' =>((!isset($tab)&&$a->argv[0]=='notes')?'active':''), + ); + } + + + $arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs); + call_hooks('profile_tabs', $arr); + + $tpl = get_markup_template('common_tabs.tpl'); + + return replace_macros($tpl,array('$tabs' => $arr['tabs'])); } - - - $arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs); - call_hooks('profile_tabs', $arr); - - $tpl = get_markup_template('common_tabs.tpl'); - - return replace_macros($tpl,array('$tabs' => $arr['tabs'])); -}} +} function get_my_url() { if(x($_SESSION,'my_url')) @@ -1445,11 +1494,13 @@ function get_my_url() { return false; } -function zrl($s) { +function zrl($s,$force = false) { if(! strlen($s)) return $s; - if(! strpos($s,'/profile/')) - return $s; + if((! strpos($s,'/profile/')) && (! $force)) + return $s; + if($force && substr($s,-1,1) !== '/') + $s = $s . '/'; $achar = strpos($s,'?') ? '&' : '?'; $mine = get_my_url(); if($mine and ! link_compare($mine,$s)) diff --git a/database.sql b/database.sql index 010c63bb2..eadb53cc6 100644 --- a/database.sql +++ b/database.sql @@ -1,19 +1,77 @@ -- phpMyAdmin SQL Dump --- version 2.11.9.4 +-- version 3.3.10.4 -- http://www.phpmyadmin.net -- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +-- -------------------------------------------------------- -- +-- Table structure for table `addon` -- +CREATE TABLE IF NOT EXISTS `addon` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` char(255) NOT NULL, + `version` char(255) NOT NULL, + `installed` tinyint(1) NOT NULL DEFAULT '0', + `timestamp` bigint(20) NOT NULL DEFAULT '0', + `plugin_admin` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `attach` +-- + +CREATE TABLE IF NOT EXISTS `attach` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `hash` char(64) NOT NULL, + `filename` char(255) NOT NULL, + `filetype` char(64) NOT NULL, + `filesize` int(11) 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, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `auth_codes` +-- + +CREATE TABLE IF NOT EXISTS `auth_codes` ( + `id` varchar(40) NOT NULL, + `client_id` varchar(20) NOT NULL, + `redirect_uri` varchar(200) NOT NULL, + `expires` int(11) NOT NULL, + `scope` varchar(250) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `cache` +-- + +CREATE TABLE IF NOT EXISTS `cache` ( + `k` char(255) NOT NULL, + `v` text NOT NULL, + `updated` datetime NOT NULL, + PRIMARY KEY (`k`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + -- -------------------------------------------------------- -- @@ -32,17 +90,36 @@ CREATE TABLE IF NOT EXISTS `challenge` ( -- -------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `config` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `cat` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, - `k` char(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, - `v` text NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `access`(`cat`,`k`) +-- +-- Table structure for table `clients` +-- + +CREATE TABLE IF NOT EXISTS `clients` ( + `client_id` varchar(20) NOT NULL, + `pw` varchar(20) NOT NULL, + `redirect_uri` varchar(200) NOT NULL, + `name` text, + `icon` text, + `uid` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`client_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- -------------------------------------------------------- +-- +-- Table structure for table `config` +-- +CREATE TABLE IF NOT EXISTS `config` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cat` char(255) CHARACTER SET ascii NOT NULL, + `k` char(255) CHARACTER SET ascii NOT NULL, + `v` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `access` (`cat`,`k`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- -- -- Table structure for table `contact` @@ -52,7 +129,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL COMMENT 'owner uid', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `self` tinyint(1) NOT NULL DEFAULT '0', + `self` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'boolean 1 == info for local UID, primarily name and photo to use in item displays.', `remote_self` tinyint(1) NOT NULL DEFAULT '0', `rel` tinyint(1) NOT NULL DEFAULT '0', `duplex` tinyint(1) NOT NULL DEFAULT '0', @@ -60,7 +137,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `name` char(255) NOT NULL, `nick` char(255) NOT NULL, `attag` char(255) NOT NULL, - `photo` text NOT NULL, + `photo` text NOT NULL COMMENT 'remote photo URL initially until approved', `thumb` text NOT NULL, `micro` text NOT NULL, `site-pubkey` text NOT NULL, @@ -96,32 +173,219 @@ CREATE TABLE IF NOT EXISTS `contact` ( `forum` tinyint(1) NOT NULL DEFAULT '0', `hidden` tinyint(1) NOT NULL DEFAULT '0', `pending` tinyint(1) NOT NULL DEFAULT '1', - `rating` tinyint(1) NOT NULL DEFAULT '0', - `reason` text NOT NULL, + `rating` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-5 reputation, 0 unknown, 1 call police, 5 inscrutable', + `reason` text NOT NULL COMMENT 'why a rating was given - will help friends decide to make friends or not', `closeness` tinyint(2) NOT NULL DEFAULT '99', `info` mediumtext NOT NULL, - `profile-id` int(11) NOT NULL DEFAULT '0', - `bdyear` CHAR( 4 ) NOT NULL COMMENT 'birthday notify flag', + `profile-id` int(11) NOT NULL DEFAULT '0' COMMENT 'which profile to display - 0 is public default', + `bdyear` char(4) NOT NULL COMMENT 'birthday notify flag', `bd` date NOT NULL, PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `self` (`self`), - KEY `network` (`network`), - KEY `name` (`name`), - KEY `nick` (`nick`), - KEY `attag` (`attag`), - KEY `url` (`url`), - KEY `nurl` (`nurl`), - KEY `addr` (`addr`), - KEY `batch` (`batch`), KEY `issued-id` (`issued-id`), KEY `dfrn-id` (`dfrn-id`), KEY `blocked` (`blocked`), KEY `readonly` (`readonly`), - KEY `forum` (`forum`), - KEY `hidden` (`hidden`), + KEY `network` (`network`), + KEY `name` (`name`), + KEY `nick` (`nick`), + KEY `attag` (`attag`), + KEY `addr` (`addr`), + KEY `url` (`url`), + KEY `batch` (`batch`), + KEY `nurl` (`nurl`), KEY `pending` (`pending`), - KEY `closeness` (`closeness`) + KEY `hidden` (`hidden`), + KEY `forum` (`forum`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `conv` +-- + +CREATE TABLE IF NOT EXISTS `conv` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `guid` char(64) NOT NULL, + `recips` mediumtext NOT NULL, + `uid` int(11) NOT NULL, + `creator` char(255) NOT NULL, + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `subject` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `created` (`created`), + KEY `updated` (`updated`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `deliverq` +-- + +CREATE TABLE IF NOT EXISTS `deliverq` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cmd` char(32) NOT NULL, + `item` int(11) NOT NULL, + `contact` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `event` +-- + +CREATE TABLE IF NOT EXISTS `event` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `cid` int(11) NOT NULL, + `uri` char(255) NOT NULL, + `created` datetime NOT NULL, + `edited` datetime NOT NULL, + `start` datetime NOT NULL, + `finish` datetime NOT NULL, + `desc` text NOT NULL, + `location` text NOT NULL, + `type` char(255) NOT NULL, + `nofinish` tinyint(1) NOT NULL DEFAULT '0', + `adjust` tinyint(1) NOT NULL DEFAULT '1', + `allow_cid` mediumtext NOT NULL, + `allow_gid` mediumtext NOT NULL, + `deny_cid` mediumtext NOT NULL, + `deny_gid` mediumtext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `fcontact` +-- + +CREATE TABLE IF NOT EXISTS `fcontact` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `url` char(255) NOT NULL, + `name` char(255) NOT NULL, + `photo` char(255) NOT NULL, + `request` char(255) NOT NULL, + `nick` char(255) NOT NULL, + `addr` char(255) NOT NULL, + `batch` char(255) NOT NULL, + `notify` char(255) NOT NULL, + `poll` char(255) NOT NULL, + `confirm` char(255) NOT NULL, + `priority` tinyint(1) NOT NULL, + `network` char(32) NOT NULL, + `alias` char(255) NOT NULL, + `pubkey` text NOT NULL, + `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `addr` (`addr`), + KEY `network` (`network`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ffinder` +-- + +CREATE TABLE IF NOT EXISTS `ffinder` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uid` int(10) unsigned NOT NULL, + `cid` int(10) unsigned NOT NULL, + `fid` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `fserver` +-- + +CREATE TABLE IF NOT EXISTS `fserver` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `server` char(255) NOT NULL, + `posturl` char(255) NOT NULL, + `key` text NOT NULL, + PRIMARY KEY (`id`), + KEY `server` (`server`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `fsuggest` +-- + +CREATE TABLE IF NOT EXISTS `fsuggest` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `cid` int(11) NOT NULL, + `name` char(255) NOT NULL, + `url` char(255) NOT NULL, + `request` char(255) NOT NULL, + `photo` char(255) NOT NULL, + `note` text NOT NULL, + `created` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `gcign` +-- + +CREATE TABLE IF NOT EXISTS `gcign` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `gcid` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `uid` (`uid`), + KEY `gcid` (`gcid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `gcontact` +-- + +CREATE TABLE IF NOT EXISTS `gcontact` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` char(255) NOT NULL, + `url` char(255) NOT NULL, + `nurl` char(255) NOT NULL, + `photo` char(255) NOT NULL, + `connect` char(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `nurl` (`nurl`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `glink` +-- + +CREATE TABLE IF NOT EXISTS `glink` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cid` int(11) NOT NULL, + `uid` int(11) NOT NULL, + `gcid` int(11) NOT NULL, + `updated` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `cid` (`cid`), + KEY `uid` (`uid`), + KEY `gcid` (`gcid`), + KEY `updated` (`updated`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -155,6 +419,33 @@ CREATE TABLE IF NOT EXISTS `group_member` ( -- -------------------------------------------------------- +-- +-- Table structure for table `guid` +-- + +CREATE TABLE IF NOT EXISTS `guid` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `guid` char(64) NOT NULL, + PRIMARY KEY (`id`), + KEY `guid` (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `hook` +-- + +CREATE TABLE IF NOT EXISTS `hook` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `hook` char(255) NOT NULL, + `file` char(255) NOT NULL, + `function` char(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `intro` -- @@ -183,18 +474,18 @@ CREATE TABLE IF NOT EXISTS `intro` ( CREATE TABLE IF NOT EXISTS `item` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `guid` char(64) NOT NULL, - `uri` char(255) NOT NULL, + `uri` char(255) CHARACTER SET ascii NOT NULL, `uid` int(10) unsigned NOT NULL DEFAULT '0', `contact-id` int(10) unsigned NOT NULL DEFAULT '0', `type` char(255) NOT NULL, `wall` tinyint(1) NOT NULL DEFAULT '0', `gravity` tinyint(1) NOT NULL DEFAULT '0', `parent` int(10) unsigned NOT NULL DEFAULT '0', - `parent-uri` char(255) NOT NULL, + `parent-uri` char(255) CHARACTER SET ascii NOT NULL, `extid` char(255) NOT NULL, `thr-parent` char(255) NOT NULL, - `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created` datetime NOT NULL, + `edited` datetime NOT NULL, `commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -213,9 +504,9 @@ CREATE TABLE IF NOT EXISTS `item` ( `target-type` char(255) NOT NULL, `target` text NOT NULL, `postopts` text NOT NULL, - `plink` char(255) NOT NULL, + `plink` char(255) NOT NULL, `resource-id` char(255) NOT NULL, - `event-id` int(10) unsigned NOT NULL, + `event-id` int(11) NOT NULL, `tag` mediumtext NOT NULL, `attach` mediumtext NOT NULL, `inform` mediumtext NOT NULL, @@ -239,42 +530,59 @@ CREATE TABLE IF NOT EXISTS `item` ( `forum_mode` tinyint(1) NOT NULL DEFAULT '0', `last-child` tinyint(1) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`), - KEY `guid` (`guid`), KEY `uri` (`uri`), KEY `uid` (`uid`), KEY `contact-id` (`contact-id`), KEY `type` (`type`), KEY `parent` (`parent`), KEY `parent-uri` (`parent-uri`), - KEY `extid` (`extid`), KEY `created` (`created`), KEY `edited` (`edited`), - KEY `received` (`received`), - KEY `moderated` (`moderated`), KEY `visible` (`visible`), - KEY `spam` (`spam`), - KEY `starred` (`starred`), - KEY `bookmark` (`bookmark`), KEY `deleted` (`deleted`), - KEY `origin` (`origin`), - KEY `forum_mode` (`forum_mode`), KEY `last-child` (`last-child`), KEY `unseen` (`unseen`), + KEY `extid` (`extid`), + KEY `received` (`received`), + KEY `starred` (`starred`), + KEY `guid` (`guid`), + KEY `origin` (`origin`), KEY `wall` (`wall`), - KEY `author-name` (`author-name`), + KEY `forum_mode` (`forum_mode`), KEY `author-link` (`author-link`), + KEY `bookmark` (`bookmark`), + KEY `moderated` (`moderated`), + KEY `spam` (`spam`), + KEY `author-name` (`author-name`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `body` (`body`), - FULLTEXT KEY `tag` (`tag`), - FULLTEXT KEY `file` (`file`), FULLTEXT KEY `allow_cid` (`allow_cid`), FULLTEXT KEY `allow_gid` (`allow_gid`), FULLTEXT KEY `deny_cid` (`deny_cid`), - FULLTEXT KEY `deny_gid` (`deny_gid`) + FULLTEXT KEY `deny_gid` (`deny_gid`), + FULLTEXT KEY `tag` (`tag`), + FULLTEXT KEY `file` (`file`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- +-- +-- Table structure for table `item_id` +-- + +CREATE TABLE IF NOT EXISTS `item_id` ( + `iid` int(11) NOT NULL, + `uid` int(11) NOT NULL, + `sid` char(255) NOT NULL, + `service` char(255) NOT NULL, + PRIMARY KEY (`iid`), + KEY `uid` (`uid`), + KEY `sid` (`sid`), + KEY `service` (`service`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `mail` -- @@ -287,26 +595,130 @@ CREATE TABLE IF NOT EXISTS `mail` ( `from-photo` char(255) NOT NULL, `from-url` char(255) NOT NULL, `contact-id` char(255) NOT NULL, - `convid` int(10) unsigned NOT NULL, + `convid` int(11) NOT NULL, `title` char(255) NOT NULL, `body` mediumtext NOT NULL, - `seen` tinyint(1) NOT NULL DEFAULT '0', + `seen` tinyint(1) NOT NULL, `reply` tinyint(1) NOT NULL DEFAULT '0', - `replied` tinyint(1) NOT NULL DEFAULT '0', + `replied` tinyint(1) NOT NULL, `unknown` tinyint(1) NOT NULL DEFAULT '0', `uri` char(255) NOT NULL, `parent-uri` char(255) NOT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), + KEY `reply` (`reply`), KEY `uid` (`uid`), KEY `guid` (`guid`), - KEY `convid` (`convid`), - KEY `reply` (`reply`), - KEY `unknown` (`unknown`), + KEY `seen` (`seen`), KEY `uri` (`uri`), KEY `parent-uri` (`parent-uri`), - KEY `created` (`created`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; + KEY `created` (`created`), + KEY `convid` (`convid`), + KEY `unknown` (`unknown`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `mailacct` +-- + +CREATE TABLE IF NOT EXISTS `mailacct` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `server` char(255) NOT NULL, + `port` int(11) NOT NULL, + `ssltype` char(16) NOT NULL, + `mailbox` char(255) NOT NULL, + `user` char(255) NOT NULL, + `pass` text NOT NULL, + `action` int(11) NOT NULL, + `movetofolder` char(255) 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', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `manage` +-- + +CREATE TABLE IF NOT EXISTS `manage` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `mid` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `uid` (`uid`), + KEY `mid` (`mid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `notify` +-- + +CREATE TABLE IF NOT EXISTS `notify` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `hash` char(64) NOT NULL, + `name` char(255) NOT NULL, + `url` char(255) NOT NULL, + `photo` char(255) NOT NULL, + `date` datetime NOT NULL, + `msg` mediumtext NOT NULL, + `uid` int(11) NOT NULL, + `link` char(255) NOT NULL, + `parent` int(11) NOT NULL, + `seen` tinyint(1) NOT NULL DEFAULT '0', + `type` int(11) NOT NULL, + `verb` char(255) NOT NULL, + `otype` char(16) NOT NULL, + PRIMARY KEY (`id`), + KEY `type` (`type`), + KEY `seen` (`seen`), + KEY `uid` (`uid`), + KEY `date` (`date`), + KEY `hash` (`hash`), + KEY `parent` (`parent`), + KEY `link` (`link`), + KEY `otype` (`otype`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `notify-threads` +-- + +CREATE TABLE IF NOT EXISTS `notify-threads` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `notify-id` int(11) NOT NULL, + `master-parent-item` int(10) unsigned NOT NULL DEFAULT '0', + `parent-item` int(10) unsigned NOT NULL DEFAULT '0', + `receiver-uid` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `master-parent-item` (`master-parent-item`), + KEY `receiver-uid` (`receiver-uid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `pconfig` +-- + +CREATE TABLE IF NOT EXISTS `pconfig` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL DEFAULT '0', + `cat` char(255) CHARACTER SET ascii NOT NULL, + `k` char(255) CHARACTER SET ascii NOT NULL, + `v` mediumtext NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `access` (`uid`,`cat`,`k`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -317,8 +729,8 @@ CREATE TABLE IF NOT EXISTS `mail` ( CREATE TABLE IF NOT EXISTS `photo` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uid` int(10) unsigned NOT NULL, - `contact-id` int(10) unsigned NOT NULL, - `guid` char(64) NOT NULL, + `contact-id` int(10) unsigned NOT NULL DEFAULT '0', + `guid` char(64) NOT NULL, `resource-id` char(255) NOT NULL, `created` datetime NOT NULL, `edited` datetime NOT NULL, @@ -340,12 +752,49 @@ CREATE TABLE IF NOT EXISTS `photo` ( KEY `resource-id` (`resource-id`), KEY `album` (`album`), KEY `scale` (`scale`), - KEY `profile` (`profile`), - KEY `guid` (`guid`) + KEY `profile` (`profile`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- +-- +-- Table structure for table `poll` +-- + +CREATE TABLE IF NOT EXISTS `poll` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `q0` mediumtext NOT NULL, + `q1` mediumtext NOT NULL, + `q2` mediumtext NOT NULL, + `q3` mediumtext NOT NULL, + `q4` mediumtext NOT NULL, + `q5` mediumtext NOT NULL, + `q6` mediumtext NOT NULL, + `q7` mediumtext NOT NULL, + `q8` mediumtext NOT NULL, + `q9` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `uid` (`uid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `poll_result` +-- + +CREATE TABLE IF NOT EXISTS `poll_result` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `poll_id` int(11) NOT NULL, + `choice` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `poll_id` (`poll_id`), + KEY `choice` (`choice`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `profile` -- @@ -366,7 +815,6 @@ CREATE TABLE IF NOT EXISTS `profile` ( `country-name` char(255) NOT NULL, `gender` char(32) NOT NULL, `marital` char(255) NOT NULL, - `showwith` tinyint(1) NOT NULL DEFAULT '0', `with` text NOT NULL, `sexual` char(255) NOT NULL, `politic` char(255) NOT NULL, @@ -403,7 +851,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( CREATE TABLE IF NOT EXISTS `profile_check` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uid` int(10) unsigned NOT NULL, - `cid` int(10) unsigned NOT NULL, + `cid` int(10) unsigned NOT NULL DEFAULT '0', `dfrn_id` char(255) NOT NULL, `sec` char(255) NOT NULL, `expire` int(11) NOT NULL, @@ -412,6 +860,59 @@ CREATE TABLE IF NOT EXISTS `profile_check` ( -- -------------------------------------------------------- +-- +-- Table structure for table `queue` +-- + +CREATE TABLE IF NOT EXISTS `queue` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` int(11) NOT NULL, + `network` char(32) NOT NULL, + `created` datetime NOT NULL, + `last` datetime NOT NULL, + `content` mediumtext NOT NULL, + `batch` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `cid` (`cid`), + KEY `network` (`network`), + KEY `created` (`created`), + KEY `last` (`last`), + KEY `batch` (`batch`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `register` +-- + +CREATE TABLE IF NOT EXISTS `register` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `hash` char(255) NOT NULL, + `created` datetime NOT NULL, + `uid` int(10) unsigned NOT NULL, + `password` char(255) NOT NULL, + `language` char(16) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `search` +-- + +CREATE TABLE IF NOT EXISTS `search` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `term` char(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `uid` (`uid`), + KEY `term` (`term`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `session` -- @@ -428,6 +929,58 @@ CREATE TABLE IF NOT EXISTS `session` ( -- -------------------------------------------------------- +-- +-- Table structure for table `sign` +-- + +CREATE TABLE IF NOT EXISTS `sign` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `iid` int(10) unsigned NOT NULL, + `signed_text` mediumtext NOT NULL, + `signature` text NOT NULL, + `signer` char(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `iid` (`iid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `spam` +-- + +CREATE TABLE IF NOT EXISTS `spam` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `spam` int(11) NOT NULL DEFAULT '0', + `ham` int(11) NOT NULL DEFAULT '0', + `term` char(255) NOT NULL, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `uid` (`uid`), + KEY `spam` (`spam`), + KEY `ham` (`ham`), + KEY `term` (`term`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tokens` +-- + +CREATE TABLE IF NOT EXISTS `tokens` ( + `id` varchar(40) NOT NULL, + `secret` text NOT NULL, + `client_id` varchar(20) NOT NULL, + `expires` int(11) NOT NULL, + `scope` varchar(200) NOT NULL, + `uid` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `user` -- @@ -441,7 +994,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', + `language` char(16) 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, @@ -451,427 +1004,47 @@ CREATE TABLE IF NOT EXISTS `user` ( `prvkey` text NOT NULL, `spubkey` text NOT NULL, `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', - `hidewall` tinyint(1) unsigned NOT NULL DEFAULT '0', - `blocktags` tinyint(1) unsigned NOT NULL DEFAULT '0', - `unkmail` tinyint(1) unsigned NOT NULL DEFAULT '0', - `cntunkmail` int(11) unsigned NOT NULL DEFAULT '10', - `notify-flags` int(11) unsigned NOT NULL DEFAULT '65535', - `page-flags` int(11) unsigned NOT NULL DEFAULT '0', + `verified` tinyint(1) unsigned NOT NULL DEFAULT '0', + `blocked` tinyint(1) unsigned NOT NULL DEFAULT '0', + `blockwall` tinyint(1) NOT NULL DEFAULT '0', + `hidewall` tinyint(1) NOT NULL DEFAULT '0', + `blocktags` tinyint(1) NOT NULL DEFAULT '0', + `unkmail` tinyint(1) NOT NULL DEFAULT '0', + `cntunkmail` int(11) NOT NULL DEFAULT '10', + `notify-flags` int(11) unsigned NOT NULL DEFAULT '65535', + `page-flags` int(11) NOT NULL DEFAULT '0', `prvnets` tinyint(1) NOT NULL DEFAULT '0', `pwdreset` char(255) NOT NULL, `maxreq` int(11) NOT NULL DEFAULT '10', - `expire` int(11) unsigned NOT NULL DEFAULT '0', - `account_expired` tinyint( 1 ) NOT NULL DEFAULT '0', + `expire` int(10) unsigned NOT NULL DEFAULT '0', + `account_expired` tinyint(1) NOT NULL DEFAULT '0', `account_expires_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `expire_notification_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `allow_cid` mediumtext NOT NULL, + `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL, - `deny_cid` mediumtext NOT NULL, + `deny_cid` mediumtext NOT NULL, `deny_gid` mediumtext NOT NULL, `openidserver` text NOT NULL, - PRIMARY KEY (`uid`), + PRIMARY KEY (`uid`), KEY `nickname` (`nickname`), + KEY `login_date` (`login_date`), KEY `account_expired` (`account_expired`), KEY `hidewall` (`hidewall`), KEY `blockwall` (`blockwall`), - KEY `unkmail` (`unkmail`), - KEY `cntunkmail` (`cntunkmail`), KEY `blocked` (`blocked`), KEY `verified` (`verified`), - KEY `login_date` (`login_date`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `register` ( - `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `hash` CHAR( 255 ) NOT NULL , - `created` DATETIME NOT NULL , - `uid` INT(11) UNSIGNED NOT NULL, - `password` CHAR(255) NOT NULL, - `language` CHAR(16) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `clients` ( -`client_id` VARCHAR( 20 ) NOT NULL , -`pw` VARCHAR( 20 ) NOT NULL , -`redirect_uri` VARCHAR( 200 ) NOT NULL , -`name` VARCHAR( 128 ) NULL DEFAULT NULL, -`icon` VARCHAR( 255 ) NULL DEFAULT NULL, -`uid` INT NOT NULL DEFAULT 0, -PRIMARY KEY ( `client_id` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `tokens` ( -`id` VARCHAR( 40 ) NOT NULL , -`secret` VARCHAR( 40 ) NOT NULL , -`client_id` VARCHAR( 20 ) NOT NULL , -`expires` INT NOT NULL , -`scope` VARCHAR( 200 ) NOT NULL , -`uid` INT NOT NULL , -PRIMARY KEY ( `id` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `auth_codes` ( -`id` VARCHAR( 40 ) NOT NULL , -`client_id` VARCHAR( 20 ) NOT NULL , -`redirect_uri` VARCHAR( 200 ) NOT NULL , -`expires` INT NOT NULL , -`scope` VARCHAR( 250 ) NOT NULL , -PRIMARY KEY ( `id` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `queue` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`cid` INT NOT NULL , -`network` CHAR( 32 ) NOT NULL, -`created` DATETIME NOT NULL , -`last` DATETIME NOT NULL , -`content` MEDIUMTEXT NOT NULL, -`batch` TINYINT( 1 ) NOT NULL DEFAULT '0', -INDEX ( `cid` ), -INDEX ( `created` ), -INDEX ( `last` ), -INDEX ( `network` ), -INDEX ( `batch` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `pconfig` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL DEFAULT '0', -`cat` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL , -`k` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL , -`v` MEDIUMTEXT NOT NULL, -UNIQUE KEY `access`(`cat`, `k`) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `hook` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`hook` CHAR( 255 ) NOT NULL , -`file` CHAR( 255 ) NOT NULL , -`function` CHAR( 255 ) NOT NULL -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `addon` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`name` CHAR( 255 ) NOT NULL , -`version` CHAR( 255 ) NOT NULL , -`installed` TINYINT( 1 ) NOT NULL DEFAULT '0' , -`timestamp` BIGINT NOT NULL DEFAULT '0' , -`plugin_admin` TINYINT( 1 ) NOT NULL DEFAULT '0' -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `event` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL , -`cid` INT NOT NULL , -`uri` CHAR( 255 ) NOT NULL, -`created` DATETIME NOT NULL , -`edited` DATETIME NOT NULL , -`start` DATETIME NOT NULL , -`finish` DATETIME NOT NULL , -`desc` TEXT NOT NULL , -`location` TEXT NOT NULL , -`type` CHAR( 255 ) NOT NULL , -`nofinish` TINYINT( 1 ) NOT NULL DEFAULT '0', -`adjust` TINYINT( 1 ) NOT NULL DEFAULT '1', -`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; - -CREATE TABLE IF NOT EXISTS `cache` ( - `k` CHAR( 255 ) NOT NULL PRIMARY KEY , - `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 , -`request` CHAR( 255 ) NOT NULL, -`nick` CHAR( 255 ) NOT NULL , -`addr` CHAR( 255 ) NOT NULL , -`batch` CHAR( 255) NOT NULL, -`notify` CHAR( 255 ) NOT NULL , -`poll` CHAR( 255 ) NOT NULL , -`confirm` CHAR( 255 ) NOT NULL , -`priority` TINYINT( 1 ) NOT NULL , -`network` CHAR( 32 ) NOT NULL , -`alias` CHAR( 255 ) NOT NULL , -`pubkey` TEXT NOT NULL , -`updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', -INDEX ( `addr` ), -INDEX ( `network` ) -) 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 `fsuggest` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL , -`cid` INT NOT NULL , -`name` CHAR( 255 ) NOT NULL , -`url` CHAR( 255 ) NOT NULL , -`request` CHAR( 255 ) NOT NULL, -`photo` CHAR( 255 ) NOT NULL , -`note` TEXT NOT NULL , -`created` DATETIME 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 , -`action` INT NOT NULL , -`movetofolder` 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 , -`hash` CHAR(64) NOT NULL, -`filename` CHAR(255) 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; - -CREATE TABLE IF NOT EXISTS `guid` ( -`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , -`guid` CHAR( 64 ) NOT NULL , -INDEX ( `guid` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `sign` ( -`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , -`iid` INT UNSIGNED NOT NULL , -`signed_text` MEDIUMTEXT NOT NULL , -`signature` TEXT NOT NULL , -`signer` CHAR( 255 ) NOT NULL , -INDEX ( `iid` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `deliverq` ( -`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , -`cmd` CHAR( 32 ) NOT NULL , -`item` INT NOT NULL , -`contact` INT NOT NULL -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `search` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL , -`term` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, -INDEX ( `uid` ), -INDEX ( `term` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `fserver` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`server` CHAR( 255 ) NOT NULL , -`posturl` CHAR( 255 ) NOT NULL , -`key` TEXT NOT NULL, -INDEX ( `server` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `gcontact` ( -`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , -`name` CHAR( 255 ) NOT NULL , -`url` CHAR( 255 ) NOT NULL , -`nurl` CHAR( 255 ) NOT NULL , -`photo` CHAR( 255 ) NOT NULL, -`connect` CHAR( 255 ) NOT NULL, -INDEX ( `nurl` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `glink` ( -`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , -`cid` INT NOT NULL , -`uid` INT NOT NULL , -`gcid` INT NOT NULL, -`updated` DATETIME NOT NULL, -INDEX ( `cid` ), -INDEX ( `uid` ), -INDEX ( `gcid` ), -INDEX ( `updated` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `gcign` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL , -`gcid` INT NOT NULL, -INDEX ( `uid` ), -INDEX ( `gcid` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `conv` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `guid` CHAR( 64 ) NOT NULL , - `recips` MEDIUMTEXT NOT NULL , - `uid` INT NOT NULL, - `creator` CHAR( 255 ) NOT NULL , - `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `subject` MEDIUMTEXT NOT NULL, - INDEX ( `created` ), - INDEX ( `updated` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `notify` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`hash` CHAR( 64 ) NOT NULL, -`type` INT( 11 ) NOT NULL , -`name` CHAR( 255 ) NOT NULL , -`url` CHAR( 255 ) NOT NULL , -`photo` CHAR( 255 ) NOT NULL , -`date` DATETIME NOT NULL , -`msg` MEDIUMTEXT NOT NULL , -`uid` INT NOT NULL , -`link` CHAR( 255 ) NOT NULL , -`parent` INT( 11 ) NOT NULL, -`seen` TINYINT( 1 ) NOT NULL DEFAULT '0', -`verb` CHAR( 255 ) NOT NULL, -`otype` CHAR( 16 ) NOT NULL, -INDEX ( `hash` ), -INDEX ( `type` ), -INDEX ( `uid` ), -INDEX ( `link` ), -INDEX ( `parent` ), -INDEX ( `seen` ), -INDEX ( `date` ), -INDEX ( `otype` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `item_id` ( -`iid` INT NOT NULL , -`uid` INT NOT NULL , -`face` CHAR( 255 ) NOT NULL , -`dspr` CHAR( 255 ) NOT NULL , -`twit` CHAR( 255 ) NOT NULL , -`stat` CHAR( 255 ) NOT NULL , -PRIMARY KEY ( `iid` ), -INDEX ( `uid` ), -INDEX ( `face` ), -INDEX ( `dspr` ), -INDEX ( `twit` ), -INDEX ( `stat` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `manage` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL , -`mid` INT NOT NULL, -INDEX ( `uid` ), -INDEX ( `mid` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `poll_result` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`poll_id` INT NOT NULL , -`choice` INT NOT NULL , -INDEX ( `poll_id` ), -INDEX ( `choice` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `poll` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL , -`q0` MEDIUMTEXT NOT NULL , -`q1` MEDIUMTEXT NOT NULL , -`q2` MEDIUMTEXT NOT NULL , -`q3` MEDIUMTEXT NOT NULL , -`q4` MEDIUMTEXT NOT NULL , -`q5` MEDIUMTEXT NOT NULL , -`q6` MEDIUMTEXT NOT NULL , -`q7` MEDIUMTEXT NOT NULL , -`q8` MEDIUMTEXT NOT NULL , -`q9` MEDIUMTEXT NOT NULL , -INDEX ( `uid` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; + KEY `unkmail` (`unkmail`), + KEY `cntunkmail` (`cntunkmail`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- -------------------------------------------------------- -- --- Table structure for table `notify-threads` +-- Table structure for table `userd` -- --- notify-id: notify.id of the first notification of this thread --- master-parent-item: item.id of the parent item --- parent-item: item.id of the imediate parent (only for multi-thread) --- not used yet. --- receiver-uid: user.uid of the receiver of this notification. --- --- If we query for a master-parent-item and receiver-uid... --- * Returns 1 item: this is not the parent notification, --- so just "follow" the thread (references to this notification) --- * Returns no item: this is the first notification related to --- this parent item. So, create the record and use the message-id --- header. - - -CREATE TABLE IF NOT EXISTS `notify-threads` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`notify-id` INT NOT NULL, -`master-parent-item` INT( 10 ) unsigned NOT NULL DEFAULT '0', -`parent-item` INT( 10 ) unsigned NOT NULL DEFAULT '0', -`receiver-uid` INT NOT NULL, -INDEX ( `master-parent-item` ), -INDEX ( `receiver-uid` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `spam` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`uid` INT NOT NULL, -`spam` INT NOT NULL DEFAULT '0', -`ham` INT NOT NULL DEFAULT '0', -`term` CHAR(255) NOT NULL, -`date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', -INDEX ( `uid` ), -INDEX ( `spam` ), -INDEX ( `ham` ), -INDEX ( `term` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `userd` ( -`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , -`username` CHAR( 255 ) NOT NULL, -INDEX ( `username` ) -) ENGINE = MyISAM DEFAULT CHARSET=utf8; - + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` char(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/doc/Account-Basics.md b/doc/Account-Basics.md index 164a6be46..41ca95b36 100644 --- a/doc/Account-Basics.md +++ b/doc/Account-Basics.md @@ -6,40 +6,41 @@ Account Basics **Registration** -Not all Friendica 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. The strength of our network is that lots of different sites are all completely compatible with each other. If the site you're visting doesn't allow registration, or you think you might prefer another one, you can find a list of public servers here, and find one that meets your needs. +Not all Friendica 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. The strength of our network is that lots of different sites are all completely compatible with each other. If the site you're visting doesn't allow registration, or you think you might prefer another one, you can find a list of public servers here, and find one that meets your needs. + +If you'd like to have your own server, you can do that too. Visit the Friendica website to download the code with setup instructions. It's a very simple install process that anybody experienced in hosting websites, or with basic Linux experience can handle easily. -If you'd like to have your own server, you can do that too. Visit the Friendica website to download the code with setup instructions. It's a very simple install process that anybody experienced in hosting websites, or with basic Linux experience can handle easily. *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'. Friendica 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**. Most people use their real name for this, but you're under no obligation to do so yourself. + *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 from your Settings page once you have logged in. This doesn't have to be your primary email address, but it does need to be a real email address. You can't get your initial password, or reset a lost password later without it. This is the only bit of personal information that has to be accurate. + *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. Please watch your email (including spam folders) for your registration details and initial password. - - - **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. @@ -55,6 +56,7 @@ Otherwise, enter your password. This will have been initially provided in your r After your first login, please visit the 'Settings' page from the top menu bar and change your password to something that you will remember. + **Getting Started** A ['Tips for New Members'](newmember) link will show up on your home page for two weeks to provide some important Getting Started information. diff --git a/doc/Bugs-and-Issues.md b/doc/Bugs-and-Issues.md index 46abea9a3..251f91e93 100644 --- a/doc/Bugs-and-Issues.md +++ b/doc/Bugs-and-Issues.md @@ -6,11 +6,11 @@ Bugs and Issues If your server has a support page, you should report any bugs/issues you encounter there first. Reporting to your support page before reporting to the developers makes their job easier, as they don't have to deal with bug reports that might not have anything to do with them, and that helps us get new features faster. -If you're a technical user, or your site doesn't have a support page, you'll need to use the Bug Tracker. Please perform a search to see if there's already an open bug that matches yours before submitting anything. +If you're a technical user, or your site doesn't have a support page, you'll need to use the Bug Tracker. Please perform a search to see if there's already an open bug that matches yours before submitting anything. Try to provide as much information as you can about the bug, including the **full** text of any error messages or notices, and any steps required to replicate the problem in as much detail as possible. It's generally better to provide too much information than not enough. -See this article to learn more about submitting **good** bug reports. +See this article to learn more about submitting **good** bug reports. **Bug Sponsorship** diff --git a/doc/Making-Friends.md b/doc/Making-Friends.md index 3f1a24c8d..70b87abbc 100644 --- a/doc/Making-Friends.md +++ b/doc/Making-Friends.md @@ -5,11 +5,11 @@ Making Friends Friendship in Friendica 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 easiest thing to do is to join the New Here group. This group is especially for people new to the Friendica network. Simply connect to the group, post to the wall, and make new friends. You don't even have to like us - comment on a few of our posts, and other people will start to add you too. +The easiest thing to do is to join the New Here group. This group is especially for people new to the Friendica network. Simply connect to the group, post to the wall, and make new friends. You don't even have to like us - comment on a few of our posts, and other people will start to add you too. The next thing you can do is look at the Directory. The directory is split up into two parts. If you click the directory button, you will be presented with a list of all members (who chose to be listed) on your server. You'll also see a link to the Global Directory. If you click through to the global directory, you will be presented with a list of everybody who chose to be listed across all instances of Friendica. You will also see a "Show Community Forums" link, which will direct you to Groups, Forums and Fanpages. You connect to people, groups and forums in the same way, except groups and forums will automatically accept your introduction request, whereas a human will approve you manually. -To connect with other Friendica user +To connect with other Friendica users: Visit their profile. Just beneath their profile picture will be the word 'Connect' (we're assuming this is an English language profile). diff --git a/doc/Plugins.md b/doc/Plugins.md index 29dff3187..df6004450 100644 --- a/doc/Plugins.md +++ b/doc/Plugins.md @@ -164,10 +164,15 @@ Your module functions will often contain the function plugin_name_content(&$a), **'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 +**'avatar_lookup'** - called when looking up the avatar + $b is (array) + 'size' => the size of the avatar that will be looked up + 'email' => email to look up the avatar for + 'url' => the (string) generated URL of the avatar + A complete list of all hook callbacks with file locations (generated 14-Feb-2012): Please see the source for details of any hooks not documented above. diff --git a/doc/Settings.md b/doc/Settings.md index 9808ecc5d..574ce8dcc 100644 --- a/doc/Settings.md +++ b/doc/Settings.md @@ -172,16 +172,6 @@ $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. diff --git a/doc/andfinally.md b/doc/andfinally.md index cd8a6994b..c4e8cb948 100644 --- a/doc/andfinally.md +++ b/doc/andfinally.md @@ -1,3 +1,5 @@ +[[!meta title="And Finally..."]] + And that brings the Quick Start to an end. Here are some more things to help get you started: @@ -5,20 +7,20 @@ Here are some more things to help get you started: **Groups** -- New Here - a group for people new to Friendica +- New Here - a group for people new to Friendica -- Friendica Support - problems? This is the place to ask. +- Friendica Support - problems? This is the place to ask. -- Public Stream - a place to talk about anything to anyone. +- Public Stream - a place to talk about anything to anyone. -- Let's Talk a group for finding people and groups who share similar interests. +- Let's Talk a group for finding people and groups who share similar interests. -- Local Friendica a page for local Friendica groups +- Local Friendica a page for local Friendica groups **Documentation** -- Connecting to more networks -- Help Index +- Connecting to more networks +- Help Index diff --git a/doc/groupsandpages.md b/doc/groupsandpages.md index 418e682c8..5cfbc653c 100644 --- a/doc/groupsandpages.md +++ b/doc/groupsandpages.md @@ -1,11 +1,11 @@ -This is the global directory. If you get lost, you can click this link to bring yourself back here. +This is the global directory. If you get lost, you can click this link to bring yourself back here. On this page, you'll find a collection of groups, forums and celebrity pages. Groups are not real people. Connecting to them is similar to "liking" something on Facebook, or signing up for a new forum. You don't have to feel awkward about introducing yourself to a new person, because they're not people! When you connect to a group, all messages to that group will start appearing in your network tab. You can comment on these posts, or post to the group yourself without ever having to add any of the groups members. This is a great way to make friends dynamically - you'll find people you like and add each other naturally instead of adding random strangers. Simply find a group you're interested in, and connect to it the same way you did with people in the last section. There are a lot of groups, and you're likely to get lost. Remember the link at the top of this page will bring you back here. -Once you've added some groups, move on to the next section. +Once you've added some groups, move on to the next section. - + diff --git a/doc/guide.md b/doc/guide.md index 178170c4e..d76af92e2 100644 --- a/doc/guide.md +++ b/doc/guide.md @@ -6,8 +6,8 @@ This is a bit like your Facebook wall. It's where all your status messgages are Once you've finished writing your post, click on the padlock icon to select who can see it. If you do not use the padlock icon, your post will be public. This means it will appear to anybody who views your profile, and in the community tab if your site has it enabled, as well as in the network tab of any of your contacts. -Play around with this a bit, then when you're ready to move on, we'll take a look at the Network Tab +Play around with this a bit, then when you're ready to move on, we'll take a look at the Network Tab - + diff --git a/doc/makingnewfriends.md b/doc/makingnewfriends.md index 35befaa36..7eff1eda1 100644 --- a/doc/makingnewfriends.md +++ b/doc/makingnewfriends.md @@ -1,11 +1,11 @@ -This is your Suggested Friends page. If you get lost, you can click this link to bring yourself back here. +This is your Suggested Friends page. If you get lost, you can click this link to bring yourself back here. This is a bit like the Friend Suggestions page of Facebook. Everybody on this list has agreed that they may be suggested as a friend. This means they're unlikely to refuse an introduction you send, and they want to meet new people too! See somebody you like the look of? Click the connect button beneath their photograph. This will bring you to the introductions page. Fill in the form as instructed, and add a small note (optional). Now, wait a bit and they'll accept your request - note that these are real people, and it might take a while. Now you've added one, you're probably lost. Click the link at the top of this page to go back to the suggested friends list and add some more. -Feel uncomfortable adding people you don't know? Don't worry - that's where Groups and Pages come in! +Feel uncomfortable adding people you don't know? Don't worry - that's where Groups and Pages come in! - + diff --git a/doc/network.md b/doc/network.md index f445b0055..afb092395 100644 --- a/doc/network.md +++ b/doc/network.md @@ -1,9 +1,9 @@ -This is your Network Tab. If you get lost, you can click this link to bring yourself back here. +This is your Network Tab. If you get lost, you can click this link to bring yourself back here. This is a bit like the Newsfeed at Facebook or the Stream at Diaspora. It's where all the posts from your contacts, groups, and feeds will appear. If you're new, you won't see anything in this page, unless you posted your status in the last step. If you've already added a few friends, you'll be able to see their posts. Here, you can comment, like, or dislike posts, or click on somebody's name to visit their profile page where you can write on their wall. -Now we need to fill it up, the first step, is to add people you already know from Facebook. +Now we need to fill it up, the first step, is to add people you already know from Facebook. - + diff --git a/doc/peopleyouknow.md b/doc/peopleyouknow.md index 143c49217..ae0c9ef59 100644 --- a/doc/peopleyouknow.md +++ b/doc/peopleyouknow.md @@ -1,13 +1,13 @@ -This is your connector settings page. If you get lost, you can click this link to bring yourself back here. +This is your connector settings page. If you get lost, you can click this link to bring yourself back here. This is the bit that makes Friendica unique. You can connect to anybody on the internet from your Friendica account using this page! The available connectors varies depending on which plugins you have installed, but for now, we'll walk you through Facebook. Note that not all servers have the Facebook connector installed. If you can't find it in the list below, don't worry, we'll look at ways of connecting to more people in the following pages. -The biggest of all social networks is Facebook. Fortunately, this connector is really easy. Scroll down the page, and click Facebook Connector Settings. Enter your Facebook user name and password and let the application (the connector) do everything the options suggest. You can fine tune this or experiment with the other connectors too. If you need help, you can always ask at Friendica Support or see the instructions here. +The biggest of all social networks is Facebook. Fortunately, this connector is really easy. Scroll down the page, and click Facebook Connector Settings. Enter your Facebook user name and password and let the application (the connector) do everything the options suggest. You can fine tune this or experiment with the other connectors too. If you need help, you can always ask at Friendica Support or see the instructions here. -When you're ready, we can move on to making new friends. +When you're ready, we can move on to making new friends. - + diff --git a/include/Contact.php b/include/Contact.php index d9949b1ef..388819b01 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -23,16 +23,24 @@ function user_remove($uid) { ); q("DELETE FROM `contact` WHERE `uid` = %d", intval($uid)); + q("DELETE FROM `gcign` WHERE `uid` = %d", intval($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 `item_id` WHERE `uid` = %d", intval($uid)); q("DELETE FROM `mail` WHERE `uid` = %d", intval($uid)); + q("DELETE FROM `mailacct` WHERE `uid` = %d", intval($uid)); + q("DELETE FROM `manage` WHERE `uid` = %d", intval($uid)); + q("DELETE FROM `notify` WHERE `uid` = %d", intval($uid)); q("DELETE FROM `photo` WHERE `uid` = %d", intval($uid)); + q("DELETE FROM `attach` 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 `search` WHERE `uid` = %d", intval($uid)); + q("DELETE FROM `spam` WHERE `uid` = %d", intval($uid)); q("DELETE FROM `user` WHERE `uid` = %d", intval($uid)); if($uid == local_user()) { unset($_SESSION['authenticated']); @@ -134,11 +142,11 @@ function contact_photo_menu($contact) { $posts_link = $a->get_baseurl() . '/network/?cid=' . $contact['id']; $menu = Array( - t("View status") => $status_link, - t("View profile") => $profile_link, - t("View photos") => $photos_link, - t("View recent") => $posts_link, - t("Edit contact") => $contact_url, + t("View Status") => $status_link, + t("View Profile") => $profile_link, + t("View Photos") => $photos_link, + t("Network Posts") => $posts_link, + t("Edit Contact") => $contact_url, t("Send PM") => $pm_url, ); @@ -150,7 +158,7 @@ function contact_photo_menu($contact) { $o = ""; foreach($menu as $k=>$v){ if ($v!="") { - if(($k !== t("View recent")) && ($k !== t("Send PM"))) + if(($k !== t("Network Posts")) && ($k !== t("Send PM"))) $o .= "