]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'master' of git://github.com/friendika/friendika
authorroot <root@diekershoff.homeunix.net>
Thu, 23 Dec 2010 06:39:23 +0000 (07:39 +0100)
committerroot <root@diekershoff.homeunix.net>
Thu, 23 Dec 2010 06:39:23 +0000 (07:39 +0100)
18 files changed:
INSTALL [deleted file]
INSTALL.txt [new file with mode: 0644]
README
boot.php
database.sql
include/items.php
include/nav.php
mod/dfrn_confirm.php
mod/dfrn_request.php
mod/follow.php
mod/install.php
mod/item.php
mod/profile.php
mod/settings.php
update.php
view/en/profile_advanced.php
view/en/settings.tpl
view/theme/default/style.css

diff --git a/INSTALL b/INSTALL
deleted file mode 100644 (file)
index 577f3f3..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,85 +0,0 @@
-
-Friendika Installation
-
-We've tried very hard to ensure that Friendika will run on commodity hosting 
-platforms - such as those used to host Wordpress blogs and Drupal websites. 
-But be aware that Friendika is more than a simple web application. It is a 
-complex communications system which more closely resembles an email server 
-than a web server. For reliability and performance, messages are delivered in
-the background and are queued for later delivery when sites are down. This
-kind of functionality requires a bit more of the host system than the typical
-blog. Not every PHP/MySQL hosting provider will be able to support Friendika. 
-Many will. But please review the requirements and confirm these with your 
-hosting provider prior to installation.
-
-
-1. Requirements
-       - Apache with mod-rewrite enabled and "Options All" so you can use a 
-local .htaccess file
-
-       - PHP > 5.1. The later the better. You'll need 5.3 for encryption of key
-exchange conversations
-encryption support
-               - PHP *command line* access with register_argc_argv set to true in the 
-php.ini file
-               - curl, gd, mysql, and openssl extensions
-               - some form of email server or email gateway such that PHP mail() works
-               - mcrypt (optional; used for end-to-end message encryption)
-
-       - Mysql 5.x
-
-       - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks
-(Windows)
-
-       - Installation into a top-level domain or sub-domain (without a 
-directory/path component in the URL) is preferred. Directory paths will
-not be as convenient to use and have not been thoroughly tested.  
-
-       [Dreamhost.com offers all of the necessary hosting features at a 
-reasonable price. If your hosting provider doesn't allow Unix shell access, 
-you might have trouble getting everything to work.] 
-
-2. Unpack the Friendika files into the root of your web server document area.
-
-       - If you copy the directory tree to your webserver, make sure
-       that you also copy .htaccess - as "dot" files are often hidden 
-       and aren't normally copied.
-
-3. Create an empty database and note the access details (hostname, username, 
-password, database name).
-
-4. Visit your website with a web browser and follow the instructions. Please 
-note any error messages and correct these before continuing.
-
-5. *If* the automated installation fails for any reason, check the following:
-
-       - ".htconfig.php" exists 
-               If not, edit htconfig.php and change system settings. Rename 
-to .htconfig.php
-       -  Database is populated.
-               If not, import the contents of "database.sql" with phpmyadmin 
-or mysql command line
-
-6. At this point visit your website again, and register your personal account. 
-Registration errors should all be recoverable automatically. 
-If you get any *critical* failure at this point, it generally indicates the
-database was not installed correctly. You might wish to move/rename 
-.htconfig.php to another name and empty (called 'dropping') the database 
-tables, so that you can start fresh.  
-
-7. Set up a cron job or scheduled task to run the poller once every 5-10 
-minutes to pick up the recent "public" postings of your friends. Example:
-
-       cd /base/directory; /path/to/php include/poller.php
-
-Change "/base/directory", and "/path/to/php" as appropriate for your situation.
-
-If you are using a Linux server, run "crontab -e" and add a line like the 
-one shown, substituting for your unique paths and settings:
-
-*/10 * * * *   cd /home/myname/mywebsite; /usr/bin/php include/poller.php
-
-You can generally find the location of PHP by executing "which php". If you 
-have troubles with this section please contact your hosting provider for 
-assistance. Friendika will not work correctly if you cannot perform this step.
-  
diff --git a/INSTALL.txt b/INSTALL.txt
new file mode 100644 (file)
index 0000000..577f3f3
--- /dev/null
@@ -0,0 +1,85 @@
+
+Friendika Installation
+
+We've tried very hard to ensure that Friendika will run on commodity hosting 
+platforms - such as those used to host Wordpress blogs and Drupal websites. 
+But be aware that Friendika is more than a simple web application. It is a 
+complex communications system which more closely resembles an email server 
+than a web server. For reliability and performance, messages are delivered in
+the background and are queued for later delivery when sites are down. This
+kind of functionality requires a bit more of the host system than the typical
+blog. Not every PHP/MySQL hosting provider will be able to support Friendika. 
+Many will. But please review the requirements and confirm these with your 
+hosting provider prior to installation.
+
+
+1. Requirements
+       - Apache with mod-rewrite enabled and "Options All" so you can use a 
+local .htaccess file
+
+       - PHP > 5.1. The later the better. You'll need 5.3 for encryption of key
+exchange conversations
+encryption support
+               - PHP *command line* access with register_argc_argv set to true in the 
+php.ini file
+               - curl, gd, mysql, and openssl extensions
+               - some form of email server or email gateway such that PHP mail() works
+               - mcrypt (optional; used for end-to-end message encryption)
+
+       - Mysql 5.x
+
+       - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks
+(Windows)
+
+       - Installation into a top-level domain or sub-domain (without a 
+directory/path component in the URL) is preferred. Directory paths will
+not be as convenient to use and have not been thoroughly tested.  
+
+       [Dreamhost.com offers all of the necessary hosting features at a 
+reasonable price. If your hosting provider doesn't allow Unix shell access, 
+you might have trouble getting everything to work.] 
+
+2. Unpack the Friendika files into the root of your web server document area.
+
+       - If you copy the directory tree to your webserver, make sure
+       that you also copy .htaccess - as "dot" files are often hidden 
+       and aren't normally copied.
+
+3. Create an empty database and note the access details (hostname, username, 
+password, database name).
+
+4. Visit your website with a web browser and follow the instructions. Please 
+note any error messages and correct these before continuing.
+
+5. *If* the automated installation fails for any reason, check the following:
+
+       - ".htconfig.php" exists 
+               If not, edit htconfig.php and change system settings. Rename 
+to .htconfig.php
+       -  Database is populated.
+               If not, import the contents of "database.sql" with phpmyadmin 
+or mysql command line
+
+6. At this point visit your website again, and register your personal account. 
+Registration errors should all be recoverable automatically. 
+If you get any *critical* failure at this point, it generally indicates the
+database was not installed correctly. You might wish to move/rename 
+.htconfig.php to another name and empty (called 'dropping') the database 
+tables, so that you can start fresh.  
+
+7. Set up a cron job or scheduled task to run the poller once every 5-10 
+minutes to pick up the recent "public" postings of your friends. Example:
+
+       cd /base/directory; /path/to/php include/poller.php
+
+Change "/base/directory", and "/path/to/php" as appropriate for your situation.
+
+If you are using a Linux server, run "crontab -e" and add a line like the 
+one shown, substituting for your unique paths and settings:
+
+*/10 * * * *   cd /home/myname/mywebsite; /usr/bin/php include/poller.php
+
+You can generally find the location of PHP by executing "which php". If you 
+have troubles with this section please contact your hosting provider for 
+assistance. Friendika will not work correctly if you cannot perform this step.
+  
diff --git a/README b/README
index efd36a1373c5cbf88d2f12fab9dfe7505d8f24f3..25fff8279fa65d8356a0a9690f3f3d303ed54bf9 100644 (file)
--- a/README
+++ b/README
@@ -79,6 +79,6 @@ friends and public updates to your hordes of fans - using the same interface.
 
 No other social network offers this ability.  
 
-IMPORTANT: Please see the file INSTALL for system requirements.
+IMPORTANT: Please see the file INSTALL.txt for system requirements.
 
 
index 9cc4d0f34f91b57796c68667733b27af89feb109..3a6886fd116767b68495c7307404f2c944d847db 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
 
 set_time_limit(0);
 
-define ( 'BUILD_ID',               1027   );
+define ( 'BUILD_ID',               1028   );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.0'  );
 
 define ( 'EOL',                    "<br />\r\n"     );
@@ -35,6 +35,13 @@ define ( 'REL_VIP',        1);
 define ( 'REL_FAN',        2);
 define ( 'REL_BUD',        3);
 
+/**
+ * Hook array order
+ */
+define ( 'HOOK_HOOK',      0);
+define ( 'HOOK_FILE',      1);
+define ( 'HOOK_FUNCTION',  2);
 
 /**
  *
@@ -372,7 +379,8 @@ function system_unavailable() {
 
 // Primarily involved with database upgrade, but also sets the 
 // base url for use in cmdline programs which don't have
-// $_SERVER variables.
+// $_SERVER variables, and synchronising the state of installed plugins.
+
 
 if(! function_exists('check_config')) {
 function check_config(&$a) {
@@ -404,6 +412,70 @@ function check_config(&$a) {
                        set_config('system','build', BUILD_ID);
                }
        }
+
+       /**
+        *
+        * 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();
+
+       $plugins = get_config('system','addon');
+       $plugins_arr = array();
+
+       if($plugins)
+               $plugins_arr = explode(',',str_replace(' ', '',$plugins));
+
+       $installed_arr = array();
+
+       if(count($installed)) {
+               foreach($installed as $i) {
+                       if(! in_array($i['name'],$plugins_arr)) {
+                               logger("Addons: uninstalling " . $i['name']);
+                               q("DELETE FROM `addon` WHERE `id` = %d LIMIT 1",
+                                       intval($i['id'])
+                               );
+
+                               @include_once('addon/' . $i['name'] . '/' . $i['name'] . '.php');
+                               if(function_exists($i['name'] . '_uninstall')) {
+                                       $func = $i['name'] . '_uninstall';
+                                       $func();
+                               }
+                       }
+                       else
+                               $installed_arr[] = $i['name'];
+               }
+       }
+
+       if(count($plugins_arr)) {
+               foreach($plugins_arr as $p) {
+                       if(! in_array($p,$installed_arr)) {
+                               logger("Addons: installing " . $p);
+                               @include_once('addon/' . $p . '/' . $p . '.php');
+                               if(function_exists($p . '_install')) {
+                                       $func = $p . '_install';
+                                       $func();
+                                       $r = q("INSERT INTO `addon` (`name`, `installed`) VALUES ( '%s', 1 ) ",
+                                               dbesc($p)
+                                       );
+                               }
+                       }
+               }
+       }
+
        return;
 }}
 
@@ -1046,6 +1118,23 @@ function set_config($family,$key,$value) {
 }}
 
 
+if(! function_exists('load_pconfig')) {
+function load_pconfig($uid,$family) {
+       global $a;
+       $r = q("SELECT * FROM `pconfig` WHERE `cat` = '%s' AND `uid` = %d",
+               dbesc($family),
+               intval($uid)
+       );
+       if(count($r)) {
+               foreach($r as $rr) {
+                       $k = $rr['k'];
+                       $a->config[$uid][$family][$k] = $rr['v'];
+               }
+       }
+}}
+
+
+
 if(! function_exists('get_pconfig')) {
 function get_pconfig($uid,$family, $key, $instore = false) {
 
@@ -1687,6 +1776,8 @@ function contact_block() {
                $o .=  '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>';
                
        }
+
+       call_hooks('contact_block_end', $o);
        return $o;
 
 }}
@@ -1946,6 +2037,8 @@ function profile_sidebar($profile) {
                '$homepage' => $homepage
        ));
 
+       call_hooks('profile_sidebar', $o);
+
        return $o;
 }}
 
@@ -1991,10 +2084,10 @@ function call_hooks($name, $data = null) {
 
        if(count($a->hooks)) {
                foreach($a->hooks as $hook) {
-                       if($hook[0] === $name) {
-                               @require_once($hook[1]);
-                               if(function_exists($hook[2])) {
-                                       $func = $hook[2];
+                       if($hook[HOOK_HOOK] === $name) {
+                               @include_once($hook[HOOK_FILE]);
+                               if(function_exists($hook[HOOK_FUNCTION])) {
+                                       $func = $hook[HOOK_FUNCTION];
                                        $func($a,$data);
                                }
                        }
index 08902d8930e4400340dd067620ba644fef6dddd4..5b86f60eca772771a99c3656e5ca1dca8a2fce52 100644 (file)
@@ -441,3 +441,13 @@ CREATE TABLE IF NOT EXISTS `hook` (
 ) 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' 
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+
+
+
index bb1b4f16b0dd912f1a5d5145ae4650589fda490d..75445ee4956c364014ec26e70cf2b324d005770d 100644 (file)
@@ -610,6 +610,8 @@ function item_store($arr) {
                }
        }
 
+       call_hooks('post_remote',$arr);
+
        dbesc_array($arr);
 
        logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
index 171309673404094a6fc8656cd72c4412bf0326de..af0c58710d0db981ca4fc2d870cfe3f0e681c189 100644 (file)
@@ -5,6 +5,7 @@
 
        $a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
 
+       $a->page['nav'] .= '<div id="site-location">' . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '</div>';
        if(local_user()) {
                $a->page['nav'] .= '<a id="nav-logout-link" class="nav-link" href="logout">' . t('Logout') . "</a>\r\n";
        }
@@ -58,7 +59,7 @@
 
 
        if($banner === false) 
-               $banner .= '<a href="http://friendika.com"><img id="logo-img" src="images/ff-32.jpg" alt="logo" /></a><span id="logo-text">Friendika</span>';
+               $banner .= '<a href="http://friendika.com"><img id="logo-img" src="images/ff-32.jpg" alt="logo" /></a><span id="logo-text"><a href="http://friendika.com">Friendika</a></span>';
 
 
        $a->page['nav'] .= '<span id="banner">' . $banner . '</span>';
index c20770481ad6158a49c370511a0bf32b17528aa9..6b9bbfe133b1adf22137ab05e5bf08c2255cc3cb 100644 (file)
@@ -386,7 +386,63 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                if($r === false)
                                notice( t('Unable to set contact photo.') . EOL);
 
+               // reload contact info
 
+               $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
+                       intval($contact_id)
+               );
+               if(count($r))
+                       $contact = $r[0];
+               else
+                       $contact = null;
+
+               // Send a new friend post if we are allowed to...
+
+               $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
+                       intval($uid)
+               );
+               if((count($r)) && ($r[0]['hide-friends'] == 0) && (is_array($contact)) &&  isset($new_relation) && ($new_relation == REL_BUD)) {
+
+                       require_once('include/items.php');
+
+                       $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
+                               intval($uid)
+                       );
+
+                       if(count($self)) {
+
+                               $arr = array();
+                               $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $uid); 
+                               $arr['uid'] = $uid;
+                               $arr['contact-id'] = $self[0]['id'];
+                               $arr['wall'] = 1;
+                               $arr['type'] = 'wall';
+                               $arr['gravity'] = 0;
+                               $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
+                               $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
+                               $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
+                               $arr['verb'] = ACTIVITY_FRIEND;
+                               $arr['object-type'] = ACTIVITY_OBJ_PERSON;
+                               $arr['body'] = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url] ' . t('is now friends with')
+                                       . ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' . "\n\n\n" 
+                                       . ' [url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
+
+                               $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
+                                       . '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
+                               $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
+                               $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
+                               $arr['object'] .= '</link></object>' . "\n";
+
+                               $i = item_store($arr);
+
+                               $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
+
+                           proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"activity\" \"$i\" &",
+                       array(),$foo));
+
+                       }
+
+               }
                // Let's send our user to the contact editor in case they want to
                // do anything special with this new friend.
 
index 6cefdd28e60c3e844a47f2c3631b01fee3338a7c..93ef4097b838c57029c023de04d700b29552601b 100644 (file)
@@ -444,7 +444,6 @@ function dfrn_request_content(&$a) {
        if(($a->argc != 2) || (! count($a->profile)))
                return "";
 
-       $a->page['template'] = 'profile';
 
        // "Homecoming". Make sure we're logged in to this site as the correct user. Then offer a confirm button
        // to send us to the post section to record the introduction.
index d5651ea39e79a397f9cf42eae9c98979d0291ad2..5f0f3f7e3d616a6e8f26bb4e729eff683ed8b6a9 100644 (file)
@@ -182,7 +182,7 @@ function follow_post(&$a) {
        );
 
 
-       if((x($contact,'notify')) && (strlen($contact['notify']))) {
+       if((count($r)) && (x($contact,'notify')) && (strlen($contact['notify']))) {
                require_once('include/salmon.php');
                slapper($r[0],$contact['notify'],$slap);
        }
index 9043459b8625ac02ca9aeca6257167d687d00e29..643f9a55ccb2b3c40d64d8fb8d946729770be45d 100644 (file)
@@ -15,7 +15,7 @@ function install_post(&$a) {
 
        require_once("dba.php");
 
-       $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, $true);
+       $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true);
 
        if(mysqli_connect_errno()) {
                $db = new dba($dbhost, $dbuser, $dbpass, '', true);
@@ -24,7 +24,7 @@ function install_post(&$a) {
                                        dbesc($dbdata)
                        );
                        if($r) 
-                               $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, $true);
+                               $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true);
                }
                if(mysqli_connect_errno()) {
                        notice( t('Could not create/connect to database.') . EOL);
@@ -65,14 +65,14 @@ function install_post(&$a) {
 
                notice( t('Database import succeeded.') . EOL 
                        . t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') . EOL 
-                       . t('Please see the file INSTALL.') . EOL );
+                       . t('Please see the file "INSTALL.txt".') . EOL );
                goaway($a->get_baseurl() . '/register' );
        }
        else {
                $db = null; // start fresh
                notice( t('Database import failed.') . EOL
                        . t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL
-                       . t('Please see the file INSTALL.') . EOL );
+                       . t('Please see the file "INSTALL.txt".') . EOL );
        }
 }
 
@@ -151,9 +151,10 @@ function check_keys() {
 
        // Get private key
 
-       if(! $res)
-               $o .=  t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
-
+       if(! $res) {
+               $o .= t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
+               $o .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".') . EOL;
+       }
        return $o;
 
 }
@@ -171,7 +172,7 @@ function check_funcs() {
        if(! function_exists('mysqli_connect')) 
                notice( t('Error: mysqli PHP module required but not installed.') . EOL);       
        if((x($_SESSION,'sysmsg')) && strlen($_SESSION['sysmsg']))
-               notice( t('Please see the file "INSTALL".') . EOL);
+               notice( t('Please see the file "INSTALL.txt".') . EOL);
 }
 
 
@@ -183,7 +184,7 @@ function check_htconfig() {
                $o = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.');
                $o .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.');
                $o .= t('Please check with your site documentation or support people to see if this situation can be corrected.');
-               $o .= t('If not, you may be required to perform a manual installation. Please see the file "INSTALL" for instructions.'); 
+               $o .= t('If not, you may be required to perform a manual installation. Please see the file "INSTALL.txt" for instructions.'); 
        }
 
        return $o;
index f0c2cc644d01b28b93fb01655b5bd4a4e8e4a915..0982bb35d34ef20e370c31e0613a789c8d7db012 100644 (file)
@@ -81,8 +81,10 @@ function item_post(&$a) {
        // get contact info for poster
 
        $author = null;
+       $self   = false;
 
        if(($_SESSION['uid']) && ($_SESSION['uid'] == $profile_uid)) {
+               $self = true;
                $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
                        intval($_SESSION['uid'])
                );
@@ -206,40 +208,82 @@ function item_post(&$a) {
 
        $uri = item_new_uri($a->get_hostname(),$profile_uid);
 
+       $datarray = array();
+       $datarray['uid']           = $profile_uid;
+       $datarray['type']          = $post_type;
+       $datarray['wall']          = $wall;
+       $datarray['gravity']       = $gravity;
+       $datarray['contact-id']    = $contact_id;
+       $datarray['owner-name']    = $contact_record['name'];
+       $datarray['owner-link']    = $contact_record['url'];
+       $datarray['owner-avatar']  = $contact_record['thumb'];
+       $datarray['author-name']   = $author['name'];
+       $datarray['author-link']   = $author['url'];
+       $datarray['author-avatar'] = $author['thumb'];
+       $datarray['created']       = datetime_convert();
+       $datarray['edited']        = datetime_convert();
+       $datarray['changed']       = datetime_convert();
+       $datarray['uri']           = $uri;
+       $datarray['title']         = $title;
+       $datarray['body']          = $body;
+       $datarray['location']      = $location;
+       $datarray['coord']         = $coord;
+       $datarray['tag']           = $str_tags;
+       $datarray['inform']        = $inform;
+       $datarray['verb']          = $verb;
+       $datarray['allow_cid']     = $str_contact_allow;
+       $datarray['allow_gid']     = $str_group_allow;
+       $datarray['deny_cid']      = $str_contact_deny;
+       $datarray['deny_gid']      = $str_group_deny;
+       $datarray['private']       = $private;
+
+       /**
+        * These fields are for the convenience of plugins...
+        * 'self' if true indicates the owner is posting on their own wall
+        * If parent is 0 it is a top-level post.
+        */
+
+       $datarray['parent']        = $parent;
+       $datarray['self']          = $self;
+
+
+       call_hooks('post_local',$datarray);
+
        $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, 
                `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`, 
                `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private` )
                VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
-               intval($profile_uid),
-               dbesc($post_type),
-               intval($wall),
-               intval($gravity),
-               intval($contact_id),
-               dbesc($contact_record['name']),
-               dbesc($contact_record['url']),
-               dbesc($contact_record['thumb']),
-               dbesc($author['name']),
-               dbesc($author['url']),
-               dbesc($author['thumb']),
-               dbesc(datetime_convert()),
-               dbesc(datetime_convert()),
-               dbesc(datetime_convert()),
-               dbesc($uri),
-               dbesc($title),
-               dbesc($body),
-               dbesc($location),
-               dbesc($coord),
-               dbesc($str_tags),
-               dbesc($inform),
-               dbesc($verb),
-               dbesc($str_contact_allow),
-               dbesc($str_group_allow),
-               dbesc($str_contact_deny),
-               dbesc($str_group_deny),
-               intval($private)
+               intval($datarray['uid']),
+               dbesc($datarray['type']),
+               intval($datarray['wall']),
+               intval($datarray['gravity']),
+               intval($datarray['contact-id']),
+               dbesc($datarray['owner-name']),
+               dbesc($datarray['owner-link']),
+               dbesc($datarray['owner-avatar']),
+               dbesc($datarray['author-name']),
+               dbesc($datarray['author-link']),
+               dbesc($datarray['author-avatar']),
+               dbesc($datarray['created']),
+               dbesc($datarray['edited']),
+               dbesc($datarray['changed']),
+               dbesc($datarray['uri']),
+               dbesc($datarray['title']),
+               dbesc($datarray['body']),
+               dbesc($datarray['location']),
+               dbesc($datarray['coord']),
+               dbesc($datarray['tag']),
+               dbesc($datarray['inform']),
+               dbesc($datarray['verb']),
+               dbesc($datarray['allow_cid']),
+               dbesc($datarray['allow_gid']),
+               dbesc($datarray['deny_cid']),
+               dbesc($datarray['deny_gid']),
+               intval($datarray['private'])
        );
+
        $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
-               dbesc($uri));
+               dbesc($datarray['uri']));
        if(count($r)) {
                $post_id = $r[0]['id'];
                logger('mod_item: saved item ' . $post_id);
@@ -276,7 +320,7 @@ function item_post(&$a) {
                                        '$email' => $user['email'],
                                        '$from' => $from,
                                        '$display' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
-                                       '$body' => strip_tags(bbcode($body))
+                                       '$body' => strip_tags(bbcode($datarray['body']))
                                ));
 
                                $res = mail($user['email'], $from . t(" commented on your item at ") . $a->config['sitename'],
@@ -299,7 +343,7 @@ function item_post(&$a) {
                                        '$email' => $user['email'],
                                        '$from' => $from,
                                        '$display' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
-                                       '$body' => strip_tags(bbcode($body))
+                                       '$body' => strip_tags(bbcode($datarray['body']))
                                ));
 
                                $res = mail($user['email'], $from . t(" posted on your profile wall at ") . $a->config['sitename'],
@@ -352,7 +396,7 @@ function item_post(&$a) {
                                        'cookie' => true
                                ));                     
                                try {
-                                       $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> bbcode($body), 'cb' => ''));
+                                       $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> bbcode($datarray['body']), 'cb' => ''));
                                } 
                                catch (FacebookApiException $e) {
                                        notice( t('Facebook status update failed.') . EOL);
index b40617d03b1d23eda51086918b308b3d9321bfd5..b1f0209307d218bd9eb267e3327c109efaee611b 100644 (file)
@@ -97,6 +97,9 @@ function profile_content(&$a, $update = 0) {
                                require_once("view/$profile_lang/profile_advanced.php");
                        else
                                require_once('view/profile_advanced.php');
+
+                       call_hooks('profile_advanced',$o);
+
                        return $o;
                }
 
index b86ff4c1c858a0409a90535cf628221d967a9740..4743ecd6611aef05eff2bf1b8b9e477cc91239e0 100644 (file)
@@ -14,6 +14,9 @@ function settings_post(&$a) {
                notice( t('Permission denied.') . EOL);
                return;
        }
+
+       call_hooks('settings_post', $_POST);
+
        if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
@@ -298,6 +301,9 @@ function settings_content(&$a) {
                '$pagetype' => $pagetype
        ));
 
+       call_hooks('settings_page',$o);
+
        return $o;
 
-}}
\ No newline at end of file
+}}
+
index 81c5f0aeaed4442f219b6e9100d433654662bf52..5807f1a34e2985d5b18d7f8d4e4ed350bb840cbf 100644 (file)
@@ -261,3 +261,12 @@ function update_1026() {
 }
 
 
+function update_1027() {
+       q("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' 
+       ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
+}
+
index 7e2036890b6ac3f6952b3620417af039f13bdf58..82c66adece9fe6791bc1dafcd7e9adeb01ae22e5 100644 (file)
@@ -223,3 +223,4 @@ $o .= <<< EOT
 EOT;
 }
 
+
index 85587afbfa2635497bd7782ad9d3da4b8a24141d..aea46374234c05e1e10c259aa19f36d05e9690d4 100644 (file)
@@ -76,7 +76,7 @@ $profile_in_net_dir
 
 
 <div id="settings-default-perms" class="settings-default-perms" >
-       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >$permissions</div>
+       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >&#x21e9; $permissions</div>
        <div id="settings-default-perms-menu-end"></div>
 
        <div id="settings-default-perms-select" style="display: none;" >
index 8ad6ee5936324f8c171cea6835492d6ca5ff88a6..f97b8f4c35d31505f0c7ac077477d760c7c1ef18 100644 (file)
@@ -72,6 +72,14 @@ blockquote:before {
        content: '>> ';
 }
 
+#site-location {
+       position: absolute;
+       right: 5px;
+       top: 3px;
+       color: white;
+       font-size: 60%;
+}
+
 .shiny {
        border-color: orange !important;
 }
@@ -148,6 +156,14 @@ blockquote:before {
        vertical-align: top;
 }
 
+#logo-text a, #logo-text a:hover, #logo-text a:visited {
+       color: #F5F6FB;
+       font-family: "gill sans MT bold", "lucida grande",tahoma,verdana,arial,sans-serif;
+       margin-left: 3px;
+       vertical-align: top;
+}
+
+
 #banner {
        color: #F5F6FB;
        font-family: "lucida grande",tahoma,verdana,arial,sans-serif;