diff --git a/INSTALL.txt b/INSTALL.txt index 70027dc4c6..fdd54b765f 100755 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -107,6 +107,11 @@ one shown, substituting for your unique paths and settings: 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. + +You should also be sure that $a->config['php_path'] is set correctly, it should +look like (changing it to the correct PHP location) + +$a->config['php_path'] = '/usr/local/php53/bin/php' Alternative: You may be able to use the 'poormancron' plugin to perform this step if you are using a recent Friendika release. 'poormancron' may result in diff --git a/boot.php b/boot.php index c2c99a55ec..0c79b6e549 100755 --- a/boot.php +++ b/boot.php @@ -9,9 +9,9 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1237' ); +define ( 'FRIENDICA_VERSION', '2.3.1255' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1118 ); +define ( 'DB_UPDATE_VERSION', 1122 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -101,10 +101,12 @@ define ( 'NETWORK_OSTATUS', 'stat'); // status.net, identi.ca, GNU-s define ( 'NETWORK_FEED', 'feed'); // RSS/Atom feeds with no known "post/notify" protocol 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_LINKEDIN', 'lnkd'); // LinkedIn define ( 'NETWORK_XMPP', 'xmpp'); // XMPP define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace +define ( 'NETWORK_GPLUS', 'goog'); // Google+ /** * Maximum number of "people who like (or don't like) this" that we will list by name @@ -123,14 +125,15 @@ define ( 'ZCURL_TIMEOUT' , (-1)); * email notification options */ -define ( 'NOTIFY_INTRO', 0x0001 ); -define ( 'NOTIFY_CONFIRM', 0x0002 ); -define ( 'NOTIFY_WALL', 0x0004 ); -define ( 'NOTIFY_COMMENT', 0x0008 ); -define ( 'NOTIFY_MAIL', 0x0010 ); -define ( 'NOTIFY_SUGGEST', 0x0020 ); -define ( 'NOTIFY_PROFILE', 0x0040 ); - +define ( 'NOTIFY_INTRO', 0x0001 ); +define ( 'NOTIFY_CONFIRM', 0x0002 ); +define ( 'NOTIFY_WALL', 0x0004 ); +define ( 'NOTIFY_COMMENT', 0x0008 ); +define ( 'NOTIFY_MAIL', 0x0010 ); +define ( 'NOTIFY_SUGGEST', 0x0020 ); +define ( 'NOTIFY_PROFILE', 0x0040 ); +define ( 'NOTIFY_TAGSELF', 0x0080 ); +define ( 'NOTIFY_TAGSHARE', 0x0100 ); /** * various namespaces we may need to parse @@ -816,7 +819,7 @@ function profile_load(&$a, $nickname, $profile = 0) { } $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` @@ -826,7 +829,7 @@ function profile_load(&$a, $nickname, $profile = 0) { intval($profile_int) ); } - if(! count($r)) { + 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", @@ -839,6 +842,16 @@ function profile_load(&$a, $nickname, $profile = 0) { $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]; diff --git a/database.sql b/database.sql index 9a2e5c8ddd..32d7cf40b4 100755 --- a/database.sql +++ b/database.sql @@ -96,6 +96,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `pending` tinyint(1) NOT NULL DEFAULT '1', `rating` tinyint(1) NOT NULL DEFAULT '0', `reason` text NOT NULL, + `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', @@ -116,7 +117,8 @@ CREATE TABLE IF NOT EXISTS `contact` ( KEY `blocked` (`blocked`), KEY `readonly` (`readonly`), KEY `hidden` (`hidden`), - KEY `pending` (`pending`) + KEY `pending` (`pending`), + KEY `closeness` (`closeness`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -224,6 +226,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `pubmail` tinyint(1) NOT NULL DEFAULT '0', `moderated` tinyint(1) NOT NULL DEFAULT '0', `visible` tinyint(1) NOT NULL DEFAULT '0', + `spam` tinyint(1) NOT NULL DEFAULT '0', `starred` tinyint(1) NOT NULL DEFAULT '0', `bookmark` tinyint(1) NOT NULL DEFAULT '0', `unseen` tinyint(1) NOT NULL DEFAULT '1', @@ -245,6 +248,7 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `received` (`received`), KEY `moderated` (`moderated`), KEY `visible` (`visible`), + KEY `spam` (`spam`), KEY `starred` (`starred`), KEY `bookmark` (`bookmark`), KEY `deleted` (`deleted`), @@ -777,3 +781,31 @@ 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; + + + + diff --git a/doc/Pages.md b/doc/Pages.md index ff2fb9fb3e..d0e6776a4b 100755 --- a/doc/Pages.md +++ b/doc/Pages.md @@ -24,7 +24,7 @@ The "Automatic Friend Account" is typically used for personal profile pages wher We recommend that you create group pages with the same email address and password as your normal account. If you do this, you will find a new "Manage" tab on the menu bar which lets you toggle identities easily and manage your pages. You are not required to do this, but the alternative is to logout and log back into the other account to manage alternate pages - and this could get cumbersome if you manage several different pages/identities. -You may also appoint a delegate to manage your page. Do this by visiting the [Delegation Setup Page](/delegate). This will provide you with a list of contacts on this system under "Potential Delegates". Selecting one or more persons will give them access to manage your page. They will be able to edit contacts, profiles, and all content for this account/page. Please use this facility wisely. Delegated managers will not be able to alter basic account settings such as passwords or page types and/or remove the account. +You may also appoint a delegate to manage your page. Do this by visiting the [Delegation Setup Page](delegate). This will provide you with a list of contacts on this system under "Potential Delegates". Selecting one or more persons will give them access to manage your page. They will be able to edit contacts, profiles, and all content for this account/page. Please use this facility wisely. Delegated managers will not be able to alter basic account settings such as passwords or page types and/or remove the account. **Posting to Community Pages** diff --git a/doc/Plugins.md b/doc/Plugins.md index 70a8726c76..29dff3187b 100755 --- a/doc/Plugins.md +++ b/doc/Plugins.md @@ -1,11 +1,20 @@ **Friendica Addon/Plugin development** -This is an early specification and hook details may be subject to change. - Please see the sample addon 'randplace' for a working example of using some of these features. The facebook addon provides an example of integrating both "addon" and "module" functionality. Addons work by intercepting event hooks - which must be registered. Modules work by intercepting specific page requests (by URL path). -Plugin names cannot contain spaces and are used as filenames. Each addon must contain both an install and an uninstall function based on the addon/plugin name. For instance "plugin1name_install()". These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your plugin will require. The install and uninstall functions will also be called (i.e. re-installed) if the plugin changes after installation - therefore your uninstall should not destroy data and install should consider that data may already exist. Future extensions may provide for "setup" amd "remove". +Plugin names cannot contain spaces or other punctuation and are used as filenames and function names. You may supply a "friendly" name within the comment block. Each addon must contain both an install and an uninstall function based on the addon/plugin name. For instance "plugin1name_install()". These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your plugin will require. The install and uninstall functions will also be called (i.e. re-installed) if the plugin changes after installation - therefore your uninstall should not destroy data and install should consider that data may already exist. Future extensions may provide for "setup" amd "remove". + +Plugins should contain a comment block with the four following parameters: + + /* + * Name: My Great Plugin + * Description: This is what my plugin does. It's really cool + * Version: 1.0 + * Author: John Q. Public + */ + + Register your plugin hooks during installation. @@ -160,7 +169,8 @@ Your module functions will often contain the function plugin_name_content(&$a), $b is (string) HTML of content div -A complete list of all hook callbacks with file locations (generated 09-Nov-2011): Please see the source for details of any hooks not documented above. +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. + boot.php: call_hooks('login_hook',$o); @@ -170,7 +180,7 @@ boot.php: call_hooks('profile_sidebar', $arr); boot.php: call_hooks("proc_run", $arr); -include/contact_selectors.php: call_hooks('network_to_name', $s); +include/contact_selectors.php: call_hooks('network_to_name', $nets); include/api.php: call_hooks('logged_in', $a->user); @@ -194,8 +204,6 @@ include/nav.php: call_hooks('page_header', $a->page['nav']); include/auth.php: call_hooks('authenticate', $addon_auth); -include/auth.php: call_hooks('logged_in', $a->user); - include/bbcode.php: call_hooks('bbcode',$Text); include/oauth.php: call_hooks('logged_in', $a->user); @@ -236,19 +244,29 @@ include/bb2diaspora.php: call_hooks('bb2diaspora',$Text); include/cronhooks.php: call_hooks('cron', $d); +include/security.php: call_hooks('logged_in', $a->user); + include/html2bbcode.php: call_hooks('html2bbcode', $text); +include/Contact.php: call_hooks('remove_user',$r[0]); + include/Contact.php: call_hooks('contact_photo_menu', $args); +include/conversation.php: call_hooks('conversation_start',$cb); + +include/conversation.php: call_hooks('render_location',$locate); + include/conversation.php: call_hooks('display_item', $arr); +include/conversation.php: call_hooks('render_location',$locate); + include/conversation.php: call_hooks('display_item', $arr); include/conversation.php: call_hooks('item_photo_menu', $args); -include/conversation.php: call_hooks('jot_tool', $jotplugins); +include/conversation.php: call_hooks('jot_tool', $jotplugins); -include/conversation.php: call_hooks('jot_networks', $jotnets); +include/conversation.php: call_hooks('jot_networks', $jotnets); include/plugin.php:if(! function_exists('call_hooks')) { @@ -282,6 +300,8 @@ mod/editpost.php: call_hooks('jot_networks', $jotnets); mod/parse_url.php: call_hooks('parse_link', $arr); +mod/home.php: call_hooks('home_init',$ret); + mod/home.php: call_hooks("home_content",$o); mod/contacts.php: call_hooks('contact_edit_post', $_POST); @@ -306,7 +326,7 @@ mod/like.php: call_hooks('post_local_end', $arr); mod/xrd.php: call_hooks('personal_xrd', $arr); -mod/item.php: call_hooks('post_local_start', $_POST); +mod/item.php: call_hooks('post_local_start', $_REQUEST); mod/item.php: call_hooks('post_local',$datarray); diff --git a/doc/developer b/doc/developer deleted file mode 100755 index dd8b316ea3..0000000000 --- a/doc/developer +++ /dev/null @@ -1,18 +0,0 @@ -Friendica Developer Guide - -Here is how you can join us. - -First, get yourself a working git package on the system where you will be -doing development. - -Create your own github account. - -Follow the instructions provided here: [[http://help.github.com/fork-a-repo/]] -to create and use your own tracking fork on github - -Then go to your github page and create a "Pull request" when you are ready -to notify us to merge your work. - -**Important** - -Please pull in any changes from the project repository and merge them with your work **before** issuing a pull request. We reserve the right to reject any patch which results in a large number of merge conflicts. This is especially true in the case of language translations - where we may not be able to understand the subtle differences between conflicting versions. \ No newline at end of file diff --git a/images/beer_mug.gif b/images/beer_mug.gif new file mode 100644 index 0000000000..a047d19873 Binary files /dev/null and b/images/beer_mug.gif differ diff --git a/images/coffee.gif b/images/coffee.gif new file mode 100644 index 0000000000..7e20371741 Binary files /dev/null and b/images/coffee.gif differ diff --git a/images/icons/10/audio.png b/images/icons/10/audio.png new file mode 100644 index 0000000000..cfc2fdcbdd Binary files /dev/null and b/images/icons/10/audio.png differ diff --git a/images/icons/10/image.png b/images/icons/10/image.png new file mode 100644 index 0000000000..dce827bbe7 Binary files /dev/null and b/images/icons/10/image.png differ diff --git a/images/icons/10/text.png b/images/icons/10/text.png new file mode 100644 index 0000000000..a9995ea4df Binary files /dev/null and b/images/icons/10/text.png differ diff --git a/images/icons/10/video.png b/images/icons/10/video.png new file mode 100644 index 0000000000..4a3dacf968 Binary files /dev/null and b/images/icons/10/video.png differ diff --git a/images/icons/10/zip.png b/images/icons/10/zip.png new file mode 100644 index 0000000000..b90ab104a5 Binary files /dev/null and b/images/icons/10/zip.png differ diff --git a/images/icons/16/audio.png b/images/icons/16/audio.png new file mode 100644 index 0000000000..f2b99981f3 Binary files /dev/null and b/images/icons/16/audio.png differ diff --git a/images/icons/16/image.png b/images/icons/16/image.png new file mode 100644 index 0000000000..c52b9730d7 Binary files /dev/null and b/images/icons/16/image.png differ diff --git a/images/icons/16/text.png b/images/icons/16/text.png new file mode 100644 index 0000000000..1f3433a562 Binary files /dev/null and b/images/icons/16/text.png differ diff --git a/images/icons/16/video.png b/images/icons/16/video.png new file mode 100644 index 0000000000..bd1a7bb57c Binary files /dev/null and b/images/icons/16/video.png differ diff --git a/images/icons/16/zip.png b/images/icons/16/zip.png new file mode 100644 index 0000000000..f0fbc0dbfd Binary files /dev/null and b/images/icons/16/zip.png differ diff --git a/images/icons/22/audio.png b/images/icons/22/audio.png new file mode 100644 index 0000000000..dbf4675cf4 Binary files /dev/null and b/images/icons/22/audio.png differ diff --git a/images/icons/22/image.png b/images/icons/22/image.png new file mode 100644 index 0000000000..f00e3a290f Binary files /dev/null and b/images/icons/22/image.png differ diff --git a/images/icons/22/text.png b/images/icons/22/text.png new file mode 100644 index 0000000000..d35e45ff8c Binary files /dev/null and b/images/icons/22/text.png differ diff --git a/images/icons/22/video.png b/images/icons/22/video.png new file mode 100644 index 0000000000..eca481ff19 Binary files /dev/null and b/images/icons/22/video.png differ diff --git a/images/icons/22/zip.png b/images/icons/22/zip.png new file mode 100644 index 0000000000..4d4ecbe9aa Binary files /dev/null and b/images/icons/22/zip.png differ diff --git a/images/icons/48/audio.png b/images/icons/48/audio.png new file mode 100644 index 0000000000..23f49b54d4 Binary files /dev/null and b/images/icons/48/audio.png differ diff --git a/images/icons/48/image.png b/images/icons/48/image.png new file mode 100644 index 0000000000..cc0c868721 Binary files /dev/null and b/images/icons/48/image.png differ diff --git a/images/icons/48/text.png b/images/icons/48/text.png new file mode 100644 index 0000000000..502394547e Binary files /dev/null and b/images/icons/48/text.png differ diff --git a/images/icons/48/video.png b/images/icons/48/video.png new file mode 100644 index 0000000000..dde02f6003 Binary files /dev/null and b/images/icons/48/video.png differ diff --git a/images/icons/48/zip.png b/images/icons/48/zip.png new file mode 100644 index 0000000000..08a9330c48 Binary files /dev/null and b/images/icons/48/zip.png differ diff --git a/images/icons/Makefile b/images/icons/Makefile index 00c4fa4c20..bfb5927df1 100755 --- a/images/icons/Makefile +++ b/images/icons/Makefile @@ -2,7 +2,8 @@ IMAGES=add.png edit.png gear.png info.png menu.png \ notify_off.png star.png delete.png feed.png group.png \ lock.png notice.png notify_on.png user.png link.png \ - play.png plugin.png unlock.png + play.png plugin.png unlock.png zip.png audio.png video.png \ + image.png text.png DESTS=10/ 16/ 22/ 48/ \ $(addprefix 10/, $(IMAGES)) \ diff --git a/images/icons/audio.png b/images/icons/audio.png new file mode 100644 index 0000000000..1e1561266f Binary files /dev/null and b/images/icons/audio.png differ diff --git a/images/icons/image.png b/images/icons/image.png new file mode 100644 index 0000000000..cec105bfda Binary files /dev/null and b/images/icons/image.png differ diff --git a/images/icons/text.png b/images/icons/text.png new file mode 100644 index 0000000000..c20190ce22 Binary files /dev/null and b/images/icons/text.png differ diff --git a/images/icons/video.png b/images/icons/video.png new file mode 100644 index 0000000000..467a2123e2 Binary files /dev/null and b/images/icons/video.png differ diff --git a/images/icons/zip.png b/images/icons/zip.png new file mode 100644 index 0000000000..df961dd49e Binary files /dev/null and b/images/icons/zip.png differ diff --git a/images/smiley-bangheaddesk.gif b/images/smiley-bangheaddesk.gif new file mode 100644 index 0000000000..91ccb8bb4d Binary files /dev/null and b/images/smiley-bangheaddesk.gif differ diff --git a/images/smiley-facepalm.gif b/images/smiley-facepalm.gif new file mode 100644 index 0000000000..7243703698 Binary files /dev/null and b/images/smiley-facepalm.gif differ diff --git a/include/attach.php b/include/attach.php index 4001d2af13..6d611cec04 100755 --- a/include/attach.php +++ b/include/attach.php @@ -38,6 +38,7 @@ function z_mime_content_type($filename) { // audio/video 'mp3' => 'audio/mpeg', + 'wav' => 'audio/wav', 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', 'ogg' => 'application/ogg', @@ -68,12 +69,13 @@ function z_mime_content_type($filename) { return $mime_types[$ext]; } } - elseif (function_exists('finfo_open')) { - $finfo = finfo_open(FILEINFO_MIME); - $mimetype = finfo_file($finfo, $filename); - finfo_close($finfo); - return $mimetype; - } +// can't use this because we're just passing a name, e.g. not a file that can be opened +// elseif (function_exists('finfo_open')) { +// $finfo = @finfo_open(FILEINFO_MIME); +// $mimetype = @finfo_file($finfo, $filename); +// @finfo_close($finfo); +// return $mimetype; +// } else { return 'application/octet-stream'; } diff --git a/include/auth.php b/include/auth.php index fd1c638473..fc52684e64 100755 --- a/include/auth.php +++ b/include/auth.php @@ -165,7 +165,7 @@ else { } if((! $record) || (! count($record))) { - logger('authenticate: failed login attempt: ' . trim($_POST['username'])); + logger('authenticate: failed login attempt: ' . notags(trim($_POST['username']))); notice( t('Login failed.') . EOL ); goaway(z_root()); } diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index d367b67166..c26b0c3341 100755 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -14,9 +14,17 @@ require_once('include/html2bbcode.php'); function diaspora2bb($s) { $s = html_entity_decode($s,ENT_COMPAT,'UTF-8'); + $s = str_replace("\r","\n",$s); $s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s); + + $s = preg_replace('/\#([^\s\#])/','\\#$1',$s); + $s = Markdown($s); + + $s = str_replace('#','#',$s); + $s = str_replace("\n",'
',$s); + $s = html2bbcode($s); // $s = str_replace('*','*',$s); @@ -30,11 +38,6 @@ function diaspora2bb($s) { $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); $s = scale_diaspora_images($s); - // we seem to get a lot of text smushed together with links from Diaspora. - - $s = preg_replace('/[^ ]\[url\=(.*?)\]/',' [url=$1]' ,$s); - $s = preg_replace('/\[\/url\][^ ]/','[/url] ',$s); - return $s; } @@ -209,7 +212,7 @@ function bb2diaspora($Text,$preserve_nl = false) { $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", 'http://vimeo.com/$1',$Text); - + $Text = str_replace('[nosmile]','',$Text); // oembed tag // $Text = oembed_bbcode2html($Text); diff --git a/include/bbcode.php b/include/bbcode.php index 6b733c8f43..cae867eb8c 100755 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -11,7 +11,7 @@ function stripcode_br_cb($s) { function tryoembed($match){ $url = ((count($match)==2)?$match[1]:$match[2]); - logger("tryoembed: $url"); +// logger("tryoembed: $url"); $o = oembed_fetch_url($url); @@ -24,13 +24,40 @@ function tryoembed($match){ } +// [noparse][i]italic[/i][/noparse] turns into +// [noparse][ i ]italic[ /i ][/noparse], +// to hide them from parser. +function bb_spacefy($st) { + $whole_match = $st[0]; + $captured = $st[1]; + $spacefied = preg_replace("/\[(.*?)\]/", "[ $1 ]", $captured); + $new_str = str_replace($captured, $spacefied, $whole_match); + return $new_str; +} + +// The previously spacefied [noparse][ i ]italic[ /i ][/noparse], +// now turns back and the [noparse] tags are trimed +// returning [i]italic[/i] + +function bb_unspacefy_and_trim($st) { + $whole_match = $st[0]; + $captured = $st[1]; + $unspacefied = preg_replace("/\[ (.*?)\ ]/", "[$1]", $captured); + return $unspacefied; +} // BBcode 2 HTML was written by WAY2WEB.net // extended to work with Mistpark/Friendica - Mike Macgirvin function bbcode($Text,$preserve_nl = false) { + // Hide all [noparse] contained bbtags spacefying them + + $Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_spacefy',$Text); + $Text = preg_replace_callback("/\[nobb\](.*?)\[\/nobb\]/ism", 'bb_spacefy',$Text); + $Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text); + // Extract a single private image which uses data url's since preg has issues with // large data sizes. Stash it away while we do bbcode conversion, and then put it back @@ -111,25 +138,34 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])ism","$2",$Text); // Check for sized text + // [size=50] --> font-size: 50px (with the unit). + $Text = preg_replace("(\[size=(\d*?)\](.*?)\[\/size\])ism","$2",$Text); $Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])ism","$2",$Text); + // Check for centered text + $Text = preg_replace("(\[center\](.*?)\[\/center\])ism","
$1
",$Text); + // Check for list text - - if(stristr($Text,'[/list]')) - $Text = str_replace("[*]", "
  • ", $Text); - - if(stristr($Text,'[/list]')) - $Text = str_replace("[*]", "
  • ", $Text); + $Text = str_replace("[*]", "
  • ", $Text); + $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '
  • $1
  • ' ,$Text); $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '' ,$Text); + $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '' +,$Text); $Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '' ,$Text); $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '' ,$Text); - $Text = preg_replace("/\[list=i\](.*?)\[\/list\]/sm",'' ,$Text); - $Text = preg_replace("/\[list=I\](.*?)\[\/list\]/sm", '' ,$Text); - $Text = preg_replace("/\[list=a\](.*?)\[\/list\]/sm", '' ,$Text); - $Text = preg_replace("/\[list=A\](.*?)\[\/list\]/sm", '' ,$Text); - $Text = preg_replace("/\[li\](.*?)\[\/li\]/sm", '
  • $1
  • ' ,$Text); + $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '' +,$Text); + $Text = preg_replace("/\[list=((?-i)i)\](.*?)\[\/list\]/ism",'' ,$Text); + $Text = preg_replace("/\[list=((?-i)I)\](.*?)\[\/list\]/ism", '' ,$Text); + $Text = preg_replace("/\[list=((?-i)a)\](.*?)\[\/list\]/ism", '' ,$Text); + $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '' ,$Text); + $Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '$1' ,$Text); $Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '$1' ,$Text); $Text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '$1' ,$Text); $Text = preg_replace("/\[table\](.*?)\[\/table\]/sm", '$1
    ' ,$Text); @@ -137,7 +173,11 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '$1
    ' ,$Text); $Text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '$1
    ' ,$Text); - + $Text = str_replace('[hr]','
    ', $Text); + + // This is actually executed in prepare_body() + + $Text = str_replace('[nosmile]','',$Text); // Check for font change text $Text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm","$2",$Text); @@ -157,7 +197,15 @@ function bbcode($Text,$preserve_nl = false) { $QuoteLayout = '
    $1
    '; // Check for [quote] text $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism","$QuoteLayout", $Text); - + + // Check for [quote=Author] text + + $t_wrote = t('$1 wrote:'); + + $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", + "
    " . $t_wrote . " $2
    ", + $Text); + // [img=widthxheight]image source[/img] $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); @@ -219,6 +267,13 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text); } + // Unhide all [noparse] contained bbtags unspacefying them + // and triming the [noparse] tag. + + $Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_unspacefy_and_trim',$Text); + $Text = preg_replace_callback("/\[nobb\](.*?)\[\/nobb\]/ism", 'bb_unspacefy_and_trim',$Text); + $Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_unspacefy_and_trim',$Text); + // fix any escaped ampersands that may have been converted into links $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text); if(strlen($saved_image)) diff --git a/include/conversation.php b/include/conversation.php index 20c7b2a511..3d13a11798 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -4,6 +4,28 @@ * Render actions localized */ function localize_item(&$item){ + + $Text = $item['body']; + $saved_image = ''; + $img_start = strpos($Text,'[img]data:'); + $img_end = strpos($Text,'[/img]'); + + if($img_start !== false && $img_end !== false && $img_end > $img_start) { + $start_fragment = substr($Text,0,$img_start); + $img_start += strlen('[img]'); + $saved_image = substr($Text,$img_start,$img_end - $img_start); + $end_fragment = substr($Text,$img_end + strlen('[/img]')); + $Text = $start_fragment . '[!#saved_image#!]' . $end_fragment; + $search = '/\[url\=(.*?)\]\[!#saved_image#!\]\[\/url\]' . '/is'; + $replace = '[url=' . z_path() . '/redir/' . $item['contact-id'] + . '?f=1&url=' . '$1' . '][!#saved_image#!][/url]' ; + + $Text = preg_replace($search,$replace,$Text); + + if(strlen($saved_image)) + $item['body'] = str_replace('[!#saved_image#!]', '[img]' . $saved_image . '[/img]',$Text); + } + $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; if ($item['verb']=== ACTIVITY_LIKE || $item['verb']=== ACTIVITY_DISLIKE){ @@ -262,15 +284,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { else $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); - if($coord) { - if($location) - $location .= '
    (' . $coord . ')'; - else - $location = '' . $coord . ''; - } + $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); + call_hooks('render_location',$locate); + $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate)); localize_item($item); if($mode === 'network-new') @@ -494,7 +511,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $likebuttons = ''; - $shareable = ((($profile_owner == local_user()) && ($mode != 'display') && (! $item['private'])) ? true : false); + $shareable = ((($profile_owner == local_user()) && (! $item['private'])) ? true : false); //($mode != 'display') && if($page_writeable) { if($toplevelpost) { @@ -505,6 +522,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share')); } + + $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null); + $qcomment = (($qc) ? explode("\n",$qc) : null); + if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) { $comment = replace_macros($cmnt_tpl,array( '$return_path' => '', @@ -512,6 +533,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { '$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'), '$id' => $item['item_id'], '$parent' => $item['parent'], + '$qcomment' => $qcomment, '$profile_uid' => $profile_owner, '$mylink' => $a->contact['url'], '$mytitle' => t('This is you'), @@ -594,16 +616,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); $dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : ''); - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); - if($coord) { - if($location) - $location .= '
    (' . $coord . ')'; - else - $location = '' . $coord . ''; - } + $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); + call_hooks('render_location',$locate); + + $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate)); $indent = (($toplevelpost) ? '' : ' comment'); @@ -620,11 +636,9 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if ($tag!="") $tags[] = bbcode($tag); } - // Build the HTML $body = prepare_body($item,true); - $tmp_item = replace_macros($template,array( '$type' => implode("",array_slice(split("/",$item['verb']),-1)), @@ -832,104 +846,114 @@ function format_like($cnt,$arr,$type,$id) { }} -function status_editor($a,$x, $notes_cid = 0) { +function status_editor($a,$x, $notes_cid = 0, $popup=false) { $o = ''; $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : ''); - $tpl = get_markup_template('jot-header.tpl'); + $plaintext = false; + if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) + $plaintext = true; + + $tpl = get_markup_template('jot-header.tpl'); - $a->page['htmlhead'] .= replace_macros($tpl, array( - '$newpost' => 'true', - '$baseurl' => $a->get_baseurl(), - '$geotag' => $geotag, - '$nickname' => $x['nickname'], - '$ispublic' => t('Visible to everybody'), - '$linkurl' => t('Please enter a link URL:'), - '$vidurl' => t("Please enter a video link/URL:"), - '$audurl' => t("Please enter an audio link/URL:"), - '$term' => t('Tag term:'), - '$whereareu' => t('Where are you right now?'), - '$title' => t('Enter a title for this item') - )); + $a->page['htmlhead'] .= replace_macros($tpl, array( + '$newpost' => 'true', + '$baseurl' => $a->get_baseurl(), + '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), + '$geotag' => $geotag, + '$nickname' => $x['nickname'], + '$ispublic' => t('Visible to everybody'), + '$linkurl' => t('Please enter a link URL:'), + '$vidurl' => t("Please enter a video link/URL:"), + '$audurl' => t("Please enter an audio link/URL:"), + '$term' => t('Tag term:'), + '$whereareu' => t('Where are you right now?'), + '$title' => t('Enter a title for this item') + )); - $tpl = get_markup_template("jot.tpl"); + $tpl = get_markup_template("jot.tpl"); - $jotplugins = ''; - $jotnets = ''; + $jotplugins = ''; + $jotnets = ''; - $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); + $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); - $mail_enabled = false; - $pubmail_enabled = false; + $mail_enabled = false; + $pubmail_enabled = false; - if(($x['is_owner']) && (! $mail_disabled)) { - $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", - intval(local_user()) - ); - if(count($r)) { - $mail_enabled = true; - if(intval($r[0]['pubmail'])) - $pubmail_enabled = true; - } + if(($x['is_owner']) && (! $mail_disabled)) { + $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", + intval(local_user()) + ); + if(count($r)) { + $mail_enabled = true; + if(intval($r[0]['pubmail'])) + $pubmail_enabled = true; } + } - if($mail_enabled) { - $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); - $jotnets .= '
    ' - . t("Post to Email") . '
    '; - } + if($mail_enabled) { + $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); + $jotnets .= '
    ' . t("Post to Email") . '
    '; + } - call_hooks('jot_tool', $jotplugins); - call_hooks('jot_networks', $jotnets); + call_hooks('jot_tool', $jotplugins); + call_hooks('jot_networks', $jotnets); - if($notes_cid) - $jotnets .= ''; + if($notes_cid) + $jotnets .= ''; - $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); + $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); - $o .= replace_macros($tpl,array( - '$return_path' => $a->cmd, - '$action' => 'item', - '$share' => (($x['button']) ? $x['button'] : t('Share')), - '$upload' => t('Upload photo'), - '$shortupload' => t('upload photo'), - '$attach' => t('Attach file'), - '$shortattach' => t('attach file'), - '$weblink' => t('Insert web link'), - '$shortweblink' => t('web link'), - '$video' => t('Insert video link'), - '$shortvideo' => t('video link'), - '$audio' => t('Insert audio link'), - '$shortaudio' => t('audio link'), - '$setloc' => t('Set your location'), - '$shortsetloc' => t('set location'), - '$noloc' => t('Clear browser location'), - '$shortnoloc' => t('clear location'), - '$title' => "", - '$placeholdertitle' => t('Set title'), - '$wait' => t('Please wait'), - '$permset' => t('Permission settings'), - '$shortpermset' => t('permissions'), - '$ptyp' => (($notes_cid) ? 'note' : 'wall'), - '$content' => '', - '$post_id' => '', - '$baseurl' => $a->get_baseurl(), - '$defloc' => $x['default_location'], - '$visitor' => $x['visitor'], - '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']), - '$emailcc' => t('CC: email addresses'), - '$public' => t('Public post'), - '$jotnets' => $jotnets, - '$emtitle' => t('Example: bob@example.com, mary@example.com'), - '$lockstate' => $x['lockstate'], - '$acl' => $x['acl'], - '$bang' => $x['bang'], - '$profile_uid' => $x['profile_uid'], - '$preview' => t('Preview'), - )); + $o .= replace_macros($tpl,array( + '$return_path' => $a->cmd, + '$action' => $a->get_baseurl().'/item', + '$share' => (($x['button']) ? $x['button'] : t('Share')), + '$upload' => t('Upload photo'), + '$shortupload' => t('upload photo'), + '$attach' => t('Attach file'), + '$shortattach' => t('attach file'), + '$weblink' => t('Insert web link'), + '$shortweblink' => t('web link'), + '$video' => t('Insert video link'), + '$shortvideo' => t('video link'), + '$audio' => t('Insert audio link'), + '$shortaudio' => t('audio link'), + '$setloc' => t('Set your location'), + '$shortsetloc' => t('set location'), + '$noloc' => t('Clear browser location'), + '$shortnoloc' => t('clear location'), + '$title' => "", + '$placeholdertitle' => t('Set title'), + '$wait' => t('Please wait'), + '$permset' => t('Permission settings'), + '$shortpermset' => t('permissions'), + '$ptyp' => (($notes_cid) ? 'note' : 'wall'), + '$content' => '', + '$post_id' => '', + '$baseurl' => $a->get_baseurl(), + '$defloc' => $x['default_location'], + '$visitor' => $x['visitor'], + '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']), + '$emailcc' => t('CC: email addresses'), + '$public' => t('Public post'), + '$jotnets' => $jotnets, + '$emtitle' => t('Example: bob@example.com, mary@example.com'), + '$lockstate' => $x['lockstate'], + '$acl' => $x['acl'], + '$bang' => $x['bang'], + '$profile_uid' => $x['profile_uid'], + '$preview' => t('Preview'), + )); + + + if ($popup==true){ + $o = ''; + + } return $o; } @@ -1004,3 +1028,17 @@ function find_thread_parent_index($arr,$x) { return $k; return false; } + +function render_location_google($item) { + $location = ''; + $location = (($item['location']) ? '' . $item['location'] . '' : ''); + $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); + if($coord) { + if($location) + $location .= '
    (' . $coord . ')'; + else + $location = '' . $coord . ''; + } + return $location; +} + diff --git a/include/datetime.php b/include/datetime.php index d44e995cfa..6d395fe3f2 100755 --- a/include/datetime.php +++ b/include/datetime.php @@ -260,10 +260,11 @@ function relative_date($posted_date) { ); foreach ($a as $secs => $str) { - $d = $etime / $secs; - if ($d >= 1) { - $r = round($d); - return $r . ' ' . (($r == 1) ? $str[0] : $str[1]) . t(' ago'); + $d = $etime / $secs; + if ($d >= 1) { + $r = round($d); + // translators - e.g. 22 hours ago, 1 minute ago + return sprintf( t('%1$d %2$s ago'),$r, (($r == 1) ? $str[0] : $str[1])); } } }} diff --git a/include/delivery.php b/include/delivery.php index c05358868a..677d893889 100755 --- a/include/delivery.php +++ b/include/delivery.php @@ -21,6 +21,7 @@ function delivery_run($argv, $argc){ require_once('include/items.php'); require_once('include/bbcode.php'); require_once('include/diaspora.php'); + require_once('include/email.php'); load_config('config'); load_config('system'); @@ -311,6 +312,13 @@ function delivery_run($argv, $argc){ ); if(count($x)) { + if($owner['page-flags'] == PAGE_COMMUNITY && ! $x[0]['writable']) { + q("update contact set writable = 1 where id = %d limit 1", + intval($x[0]['id']) + ); + $x[0]['writable'] = 1; + } + require_once('library/simplepie/simplepie.inc'); logger('mod-delivery: local delivery'); local_delivery($x[0],$atom); @@ -373,7 +381,8 @@ function delivery_run($argv, $argc){ break; case NETWORK_MAIL : - + case NETWORK_MAIL2: + if(get_config('system','dfrn_only')) break; // WARNING: does not currently convert to RFC2047 header encodings, etc. @@ -412,8 +421,15 @@ function delivery_run($argv, $argc){ if($r1 && $r1[0]['reply_to']) $reply_to = $r1[0]['reply_to']; - $subject = (($it['title']) ? $it['title'] : t("\x28no subject\x29")) ; - $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n"; + $subject = (($it['title']) ? email_header_encode($it['title'],'UTF-8') : t("\x28no subject\x29")) ; + + // only expose our real email address to true friends + + if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked'])) + $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . $local_user[0]['email'] . '>' . "\n"; + else + $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; + if($reply_to) $headers .= 'Reply-to: ' . $reply_to . "\n"; $headers .= 'Message-id: <' . $it['uri'] . '>' . "\n"; diff --git a/include/diaspora.php b/include/diaspora.php index cded389c38..a8e02e5097 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -598,7 +598,7 @@ function diaspora_request($importer,$xml) { `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, - `pending` = 0, + `pending` = 0 WHERE `id` = %d LIMIT 1 ", dbesc($photos[0]), @@ -611,7 +611,7 @@ function diaspora_request($importer,$xml) { intval($contact_record['id']) ); - $u = q("select * from user where id = %d limit 1",intval($importer['uid'])); + $u = q("select * from user where uid = %d limit 1",intval($importer['uid'])); if($u) $ret = diaspora_share($u[0],$contact_record); } @@ -673,6 +673,14 @@ function diaspora_post($importer,$xml) { if(strpos($tag,'#') === 0) { if(strpos($tag,'[url=')) continue; + + // don't link tags that are already embedded in links + + if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body)) + continue; + if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body)) + continue; + $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -830,6 +838,15 @@ function diaspora_reshare($importer,$xml) { if(strpos($tag,'#') === 0) { if(strpos($tag,'[url=')) continue; + + // don't link tags that are already embedded in links + + if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body)) + continue; + if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body)) + continue; + + $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -1062,6 +1079,15 @@ function diaspora_comment($importer,$xml,$msg) { if(strpos($tag,'#') === 0) { if(strpos($tag,'[url=')) continue; + + // don't link tags that are already embedded in links + + if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body)) + continue; + if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body)) + continue; + + $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -1282,6 +1308,7 @@ function diaspora_conversation($importer,$xml,$msg) { 'language' => $importer['language'], 'to_name' => $importer['username'], 'to_email' => $importer['email'], + 'uid' =>$importer['importer_uid'], 'item' => array('subject' => $subject, 'body' => $body), 'source_name' => $person['name'], 'source_link' => $person['url'], diff --git a/include/enotify.php b/include/enotify.php index 9df9b57e5d..a8e6e3de6d 100755 --- a/include/enotify.php +++ b/include/enotify.php @@ -28,17 +28,19 @@ function notification($params) { $subject = sprintf( t('New mail received at %s'),$sitename); $preamble = sprintf( t('%s sent you a new private message at %s.'),$params['source_name'],$sitename); - + $epreamble = sprintf( t('%s sent you a private message.'),'[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); $sitelink = t('Please visit %s to view and/or reply to your private messages.'); $tsitelink = sprintf( $sitelink, $siteurl . '/message' ); $hsitelink = sprintf( $sitelink, '' . $sitename . ''); - $itemlink = ''; + $itemlink = $siteurl . '/message'; } if($params['type'] == NOTIFY_COMMENT) { $subject = sprintf( t('%s commented on an item at %s'), $params['source_name'], $sitename); $preamble = sprintf( t('%s commented on an item/conversation you have been following.'), $params['source_name']); + $epreamble = sprintf( t('%s commented on an item/conversation you have been following.'), '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $sitelink = t('Please visit %s to view and/or reply to the conversation.'); $tsitelink = sprintf( $sitelink, $siteurl ); $hsitelink = sprintf( $sitelink, '' . $sitename . ''); @@ -47,6 +49,27 @@ function notification($params) { if($params['type'] == NOTIFY_WALL) { $preamble = $subject = sprintf( t('%s posted to your profile wall at %s') , $params['source_name'], $sitename); + $epreamble = sprintf( t('%s posted to your profile wall') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + + $sitelink = t('Please visit %s to view and/or reply to the conversation.'); + $tsitelink = sprintf( $sitelink, $siteurl ); + $hsitelink = sprintf( $sitelink, '' . $sitename . ''); + $itemlink = $params['link']; + } + + if($params['type'] == NOTIFY_TAGSELF) { + $preamble = $subject = sprintf( t('%s tagged you at %s') , $params['source_name'], $sitename); + $epreamble = sprintf( t('%s tagged you') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + + $sitelink = t('Please visit %s to view and/or reply to the conversation.'); + $tsitelink = sprintf( $sitelink, $siteurl ); + $hsitelink = sprintf( $sitelink, '' . $sitename . ''); + $itemlink = $params['link']; + } + + if($params['type'] == NOTIFY_TAGSHARE) { + $preamble = $subject = sprintf( t('%s tagged your post at %s') , $params['source_name'], $sitename); + $epreamble = sprintf( t('%s tagged your post') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); $tsitelink = sprintf( $sitelink, $siteurl ); @@ -57,6 +80,7 @@ function notification($params) { if($params['type'] == NOTIFY_INTRO) { $subject = sprintf( t('Introduction received at %s'), $sitename); $preamble = sprintf( t('You\'ve received an introduction from \'%s\' at %s'), $params['source_name'], $sitename); + $epreamble = sprintf( t('You\'ve received an introduction from %s'), '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); $body = sprintf( t('You may visit their profile at %s'),$params['source_link']); $sitelink = t('Please visit %s to approve or reject the introduction.'); @@ -68,6 +92,9 @@ function notification($params) { if($params['type'] == NOTIFY_SUGGEST) { $subject = sprintf( t('Friend suggestion received at %s'), $sitename); $preamble = sprintf( t('You\'ve received a friend suggestion from \'%s\' at %s'), $params['source_name'], $sitename); + $epreamble = sprintf( t('You\'ve received a friend suggestion for %s from %s'), + '[url=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/url]', + '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); $body = t('Name:') . ' ' . $params['item']['name'] . "\n"; $body .= t('Photo:') . ' ' . $params['item']['photo'] . "\n"; $body .= sprintf( t('You may visit their profile at %s'),$params['item']['url']); @@ -82,9 +109,27 @@ function notification($params) { } - // TODO - create notification entry in DB + // from here on everything is in the recipients language + push_lang($params['language']); + require_once('include/html2bbcode.php'); + + // create notification entry in DB + + $r = q("insert into notify (name,url,photo,date,msg,uid,link,type,verb,otype) + values('%s','%s','%s','%s','%s',%d,'%s',%d,'%s','%s')", + dbesc($params['source_name']), + dbesc($params['source_link']), + dbesc($params['source_photo']), + dbesc(datetime_convert()), + dbesc($epreamble), + intval($params['uid']), + dbesc($itemlink), + intval($params['type']), + dbesc($params['verb']), + dbesc($params['otype']) + ); // send email notification if notification preferences permit @@ -93,7 +138,6 @@ function notification($params) { logger('notification: sending notification email'); - push_lang($params['language']); $textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n", $body))),ENT_QUOTES,'UTF-8')); @@ -108,7 +152,7 @@ function notification($params) { '$preamble' => $preamble, '$sitename' => $sitename, '$siteurl' => $siteurl, - '$source_name' => $parama['source_name'], + '$source_name' => $params['source_name'], '$source_link' => $params['source_link'], '$source_photo' => $params['source_photo'], '$username' => $params['to_name'], @@ -128,7 +172,7 @@ function notification($params) { '$preamble' => $preamble, '$sitename' => $sitename, '$siteurl' => $siteurl, - '$source_name' => $parama['source_name'], + '$source_name' => $params['source_name'], '$source_link' => $params['source_link'], '$source_photo' => $params['source_photo'], '$username' => $params['to_name'], @@ -153,8 +197,10 @@ function notification($params) { 'htmlVersion' => $email_html_body, 'textVersion' => $email_text_body )); - pop_lang(); } + + pop_lang(); + } require_once('include/email.php'); diff --git a/include/expire.php b/include/expire.php index 64dbe2536d..5fa0ec758b 100755 --- a/include/expire.php +++ b/include/expire.php @@ -29,6 +29,11 @@ function expire_run($argv, $argc){ $a->set_baseurl(get_config('system','url')); + // physically remove anything that has been deleted for more than two months + + $r = q("delete from item where deleted = 1 and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY"); + q("optimize table item"); + logger('expire: start'); $r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0"); diff --git a/include/items.php b/include/items.php index 62f1f2ce5b..f4837449d7 100755 --- a/include/items.php +++ b/include/items.php @@ -814,6 +814,11 @@ function item_store($arr,$force_parent = false) { call_hooks('post_remote',$arr); + if(x($arr,'cancel')) { + logger('item_store: post cancelled by plugin.'); + return 0; + } + dbesc_array($arr); logger('item_store: ' . print_r($arr,true), LOGGER_DATA); @@ -900,7 +905,7 @@ function item_store($arr,$force_parent = false) { ); } - tgroup_deliver($arr['uid'],$current_post); + tag_deliver($arr['uid'],$current_post); return $current_post; } @@ -918,22 +923,22 @@ function get_item_contact($item,$contacts) { } -function tgroup_deliver($uid,$item_id) { +function tag_deliver($uid,$item_id) { - - // setup a second delivery chain for forum/community posts if appropriate + // look for mention tags and setup a second delivery chain for forum/community posts if appropriate $a = get_app(); - $deliver_to_tgroup = false; + $mention = false; - $u = q("select * from user where uid = %d and `page-flags` = %d limit 1", - intval($uid), - intval(PAGE_COMMUNITY) + $u = q("select uid, nickname, language, username, email, `page-flags`, `notify-flags` from user where uid = %d limit 1", + intval($uid) ); if(! count($u)) return; + $community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false); + $i = q("select * from item where id = %d and uid = %d limit 1", intval($item_id), intval($uid) @@ -943,13 +948,6 @@ function tgroup_deliver($uid,$item_id) { $item = $i[0]; - // prevent delivery looping - only proceed - // if the message originated elsewhere and is a top-level post - - if(($item['wall']) || ($item['origin']) || ($item['id'] != $item['parent'])) - return; - - $link = normalise_link($a->get_baseurl() . '/profile/' . $u[0]['nickname']); // Diaspora uses their own hardwired link URL in @-tags @@ -961,19 +959,57 @@ function tgroup_deliver($uid,$item_id) { if($cnt) { foreach($matches as $mtch) { if(link_compare($link,$mtch[1]) || link_compare($dlink,$mtch[1])) { - $deliver_to_tgroup = true; - logger('tgroup_deliver: local group mention found: ' . $mtch[2]); + $mention = true; + logger('tag_deliver: mention found: ' . $mtch[2]); } } } - if(! $deliver_to_tgroup) + if(! $mention) + return; + + // send a notification + + require_once('include/enotify.php'); + notification(array( + 'type' => NOTIFY_TAGSELF, + 'notify_flags' => $u[0]['notify-flags'], + 'language' => $u[0]['language'], + 'to_name' => $u[0]['username'], + 'to_email' => $u[0]['email'], + 'uid' => $u[0]['uid'], + 'item' => $item, + 'link' => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'], + 'source_name' => $item['author-name'], + 'source_link' => $item['author-link'], + 'source_photo' => $item['author-avatar'], + 'verb' => ACTIVITY_TAG, + 'otype' => 'item' + )); + + if(! $community_page) + return; + + // tgroup delivery - setup a second delivery chain + // prevent delivery looping - only proceed + // if the message originated elsewhere and is a top-level post + + if(($item['wall']) || ($item['origin']) || ($item['id'] != $item['parent'])) return; // now change this copy of the post to a forum head message and deliver to all the tgroup members - q("update item set wall = 1, origin = 1, forum_mode = 1 where id = %d limit 1", + $c = q("select name, url, thumb from contact where self = 1 and uid = %d limit 1", + intval($u[0]['uid']) + ); + if(! count($c)) + return; + + q("update item set wall = 1, origin = 1, forum_mode = 1, `owner-name` = '%s', `owner-link` = '%s', `owner-avatar` = '%s' where id = %d limit 1", + dbesc($c[0]['name']), + dbesc($c[0]['url']), + dbesc($c[0]['thumb']), intval($item_id) ); @@ -990,8 +1026,8 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $a = get_app(); - if((! strlen($contact['issued-id'])) && (! $contact['duplex']) && (! ($owner['page-flags'] == PAGE_COMMUNITY))) - return 3; +// if((! strlen($contact['issued-id'])) && (! $contact['duplex']) && (! ($owner['page-flags'] == PAGE_COMMUNITY))) +// return 3; $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']); @@ -1042,7 +1078,9 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $final_dfrn_id = ''; - if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) { + if(($contact['duplex'] && strlen($contact['pubkey'])) + || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey'])) + || ($contact['rel'] == CONTACT_IS_SHARING && strlen($contact['pubkey']))) { openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']); openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']); } @@ -1085,7 +1123,10 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { if($dfrn_version >= 2.1) { - if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) { + if(($contact['duplex'] && strlen($contact['pubkey'])) + || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey'])) + || ($contact['rel'] == CONTACT_IS_SHARING && strlen($contact['pubkey']))) { + openssl_public_encrypt($key,$postvars['key'],$contact['pubkey']); } else { @@ -1481,7 +1522,8 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) if(count($r)) { if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) { - $r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + dbesc($datarray['title']), dbesc($datarray['body']), dbesc(datetime_convert('UTC','UTC',$datarray['edited'])), dbesc($item_id), @@ -1611,7 +1653,8 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) if(count($r)) { if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) { - $r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + dbesc($datarray['title']), dbesc($datarray['body']), dbesc(datetime_convert('UTC','UTC',$datarray['edited'])), dbesc($item_id), @@ -1806,6 +1849,7 @@ function local_delivery($importer,$data) { 'language' => $importer['language'], 'to_name' => $importer['username'], 'to_email' => $importer['email'], + 'uid' => $importer['importer_uid'], 'item' => $fsugg, 'link' => $a->get_baseurl() . '/notifications/intros', 'source_name' => $importer['name'], @@ -1857,6 +1901,7 @@ function local_delivery($importer,$data) { 'language' => $importer['language'], 'to_name' => $importer['username'], 'to_email' => $importer['email'], + 'uid' => $importer['importer_uid'], 'item' => $msg, 'source_name' => $msg['from-name'], 'source_link' => $importer['url'], @@ -2129,6 +2174,7 @@ function local_delivery($importer,$data) { 'language' => $importer['language'], 'to_name' => $importer['username'], 'to_email' => $importer['email'], + 'uid' => $importer['importer_uid'], 'item' => $datarray, 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, 'source_name' => stripslashes($datarray['author-name']), @@ -2162,7 +2208,8 @@ function local_delivery($importer,$data) { if(count($r)) { if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) { - $r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + dbesc($datarray['title']), dbesc($datarray['body']), dbesc(datetime_convert('UTC','UTC',$datarray['edited'])), dbesc($item_id), @@ -2248,6 +2295,7 @@ function local_delivery($importer,$data) { 'language' => $importer['language'], 'to_name' => $importer['username'], 'to_email' => $importer['email'], + 'uid' => $importer['importer_uid'], 'item' => $datarray, 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, 'source_name' => stripslashes($datarray['author-name']), @@ -2304,7 +2352,8 @@ function local_delivery($importer,$data) { if(count($r)) { if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) { - $r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", + dbesc($datarray['title']), dbesc($datarray['body']), dbesc(datetime_convert('UTC','UTC',$datarray['edited'])), dbesc($item_id), @@ -2800,7 +2849,7 @@ function drop_item($id,$interactive = true) { // delete the item - $r = q("UPDATE `item` SET `deleted` = 1, `body` = '', `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1", + $r = q("UPDATE `item` SET `deleted` = 1, `title` = '', `body` = '', `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), dbesc(datetime_convert()), intval($item['id']) @@ -2833,7 +2882,7 @@ function drop_item($id,$interactive = true) { // If it's the parent of a comment thread, kill all the kids if($item['uri'] == $item['parent-uri']) { - $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', `body` = '' + $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', `body` = '' , `title` = '' WHERE `parent-uri` = '%s' AND `uid` = %d ", dbesc(datetime_convert()), dbesc(datetime_convert()), diff --git a/include/network.php b/include/network.php index 551d5e1d0f..25db62d161 100755 --- a/include/network.php +++ b/include/network.php @@ -579,6 +579,9 @@ function fetch_xrd_links($url) { if(! function_exists('validate_url')) { function validate_url(&$url) { + // no naked subdomains + if(strpos($url,'.') === false) + return false; if(substr($url,0,4) != 'http') $url = 'http://' . $url; $h = @parse_url($url); diff --git a/include/notifier.php b/include/notifier.php index ead7aebad4..37bc6dae51 100755 --- a/include/notifier.php +++ b/include/notifier.php @@ -35,7 +35,7 @@ function notifier_run($argv, $argc){ require_once("datetime.php"); require_once('include/items.php'); require_once('include/bbcode.php'); - + require_once('include/email.php'); load_config('config'); load_config('system'); @@ -264,7 +264,7 @@ function notifier_run($argv, $argc){ $deny_people = expand_acl($parent['deny_cid']); $deny_groups = expand_groups(expand_acl($parent['deny_gid'])); - // if our parent is a forum, uplink to the origonal author causing + // if our parent is a forum, uplink to the origional author causing // a delivery fork if(intval($parent['forum_mode']) && (! $top_level) && ($cmd !== 'uplink')) { @@ -526,6 +526,14 @@ function notifier_run($argv, $argc){ ); if(count($x)) { + + if($owner['page-flags'] == PAGE_COMMUNITY && ! $x[0]['writable']) { + q("update contact set writable = 1 where id = %d limit 1", + intval($x[0]['id']) + ); + $x[0]['writable'] = 1; + } + require_once('library/simplepie/simplepie.inc'); logger('mod-delivery: local delivery'); local_delivery($x[0],$atom); @@ -584,6 +592,7 @@ function notifier_run($argv, $argc){ break; case NETWORK_MAIL: + case NETWORK_MAIL2: if(get_config('system','dfrn_only')) break; @@ -625,14 +634,14 @@ function notifier_run($argv, $argc){ if($r1 && $r1[0]['reply_to']) $reply_to = $r1[0]['reply_to']; - $subject = (($it['title']) ? $it['title'] : t("\x28no subject\x29")) ; + $subject = (($it['title']) ? email_header_encode($it['title'],'UTF-8') : t("\x28no subject\x29")) ; // only expose our real email address to true friends - if($contact['rel'] == CONTACT_IS_FRIEND) - $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n"; + if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked'])) + $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . $local_user[0]['email'] . '>' . "\n"; else - $headers = 'From: ' . $local_user[0]['username'] . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; + $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; if($reply_to) $headers .= 'Reply-to: ' . $reply_to . "\n"; @@ -754,9 +763,10 @@ function notifier_run($argv, $argc){ ); $r2 = q("SELECT `id`, `name`,`network` FROM `contact` - WHERE `network` = '%s' AND `uid` = %d AND `blocked` = 0 AND `pending` = 0 + WHERE `network` in ( '%s', '%s') AND `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `rel` != %d order by rand() ", dbesc(NETWORK_DFRN), + dbesc(NETWORK_MAIL2), intval($owner['uid']), intval(CONTACT_IS_SHARING) ); diff --git a/include/oembed.php b/include/oembed.php index 118f7fa4a3..5c3c595f57 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -11,7 +11,7 @@ function oembed_replacecb($matches){ function oembed_fetch_url($embedurl){ - + $txt = Cache::get($embedurl); $noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm"); diff --git a/include/plugin.php b/include/plugin.php index fe325ac3b0..85b51edff5 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -56,25 +56,29 @@ function reload_plugins() { if(count($parr)) { foreach($parr as $pl) { $pl = trim($pl); - - $t = filemtime('addon/' . $pl . '/' . $pl . '.php'); - foreach($installed as $i) { - if(($i['name'] == $pl) && ($i['timestamp'] != $t)) { - logger('Reloading plugin: ' . $i['name']); - @include_once('addon/' . $pl . '/' . $pl . '.php'); - if(function_exists($pl . '_uninstall')) { - $func = $pl . '_uninstall'; - $func(); + $fname = 'addon/' . $pl . '/' . $pl . '.php'; + + if(file_exists($fname)) { + $t = @filemtime($fname); + foreach($installed as $i) { + if(($i['name'] == $pl) && ($i['timestamp'] != $t)) { + logger('Reloading plugin: ' . $i['name']); + @include_once($fname); + + if(function_exists($pl . '_uninstall')) { + $func = $pl . '_uninstall'; + $func(); + } + if(function_exists($pl . '_install')) { + $func = $pl . '_install'; + $func(); + } + q("UPDATE `addon` SET `timestamp` = %d WHERE `id` = %d LIMIT 1", + intval($t), + intval($i['id']) + ); } - if(function_exists($pl . '_install')) { - $func = $pl . '_install'; - $func(); - } - q("UPDATE `addon` SET `timestamp` = %d WHERE `id` = %d LIMIT 1", - intval($t), - intval($i['id']) - ); } } } diff --git a/include/poller.php b/include/poller.php index 89e4488b92..7d42c63b5f 100755 --- a/include/poller.php +++ b/include/poller.php @@ -369,7 +369,7 @@ function poller_run($argv, $argc){ $xml = fetch_url($contact['poll']); } - elseif($contact['network'] === NETWORK_MAIL) { + elseif($contact['network'] === NETWORK_MAIL || $contact['network'] === NETWORK_MAIL2) { $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); if($mail_disabled) @@ -462,7 +462,7 @@ function poller_run($argv, $argc){ $datarray['contact-id'] = $contact['id']; if($datarray['parent-uri'] === $datarray['uri']) $datarray['private'] = 1; - if(! get_pconfig($importer_uid,'system','allow_public_email_replies')) { + if(($contact['network'] === NETWORK_MAIL) && (! get_pconfig($importer_uid,'system','allow_public_email_replies'))) { $datarray['private'] = 1; $datarray['allow_cid'] = '<' . $contact['id'] . '>'; } diff --git a/include/profile_advanced.php b/include/profile_advanced.php index ccecb95dee..004a58524b 100755 --- a/include/profile_advanced.php +++ b/include/profile_advanced.php @@ -44,6 +44,8 @@ function advanced_profile(&$a) { if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) ); + if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']); + if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']); if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']); diff --git a/include/text.php b/include/text.php index 5f4adb27c3..b9813cfa9f 100755 --- a/include/text.php +++ b/include/text.php @@ -428,8 +428,10 @@ if(! function_exists('logger')) { function logger($msg,$level = 0) { // turn off logger in install mode global $a; - if ($a->module == 'install') return; - + global $db; + + if(($a->module == 'install') || (! ($db && $db->connected))) return; + $debugging = get_config('system','debugging'); $loglevel = intval(get_config('system','loglevel')); $logfile = get_config('system','logfile'); @@ -538,8 +540,10 @@ function contact_block() { $a = get_app(); $shown = get_pconfig($a->profile['uid'],'system','display_friend_count'); - if(! $shown) + if($shown === false) $shown = 24; + if($shown == 0) + return; if((! is_array($a->profile)) || ($a->profile['hide-friends'])) return $o; @@ -674,41 +678,105 @@ function linkify($s) { */ if(! function_exists('smilies')) { -function smilies($s) { +function smilies($s, $sample = false) { $a = get_app(); - $s = str_replace( - array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', '\\o/', 'o.O', 'O.o', '\\.../', '\\ooo/', - '~friendika', '~friendica', 'Diaspora*' ), - array( + $texts = array( + '<3', + '</3', + '<\\3', + ':-)', +// ':)', + ';-)', +// ';)', + ':-(', +// ':(', + ':-P', +// ':P', + ':-"', + ':-"', + ':-x', + ':-X', + ':-D', +// ':D', + '8-|', + '8-O', + ':-O', + '\\o/', + 'o.O', + 'O.o', + '\\.../', + '\\ooo/', + ":'(", + ":-!", + ":-/", + ":-[", + "8-)", + ':beer', + ':homebrew', + ':coffee', + ':facepalm', + ':headdesk', + '~friendika', + '~friendica', + 'Diaspora*' + ); + + $icons = array( '<3', '</3', '<\\3', ':-)', - ':)', +// ':)', ';-)', +// ';)', ':-(', - ':(', +// ':(', ':-P', - ':P', +// ':P', + ':-\', ':-\', ':-x', ':-X', ':-D', +// ':D', '8-|', '8-O', + ':-O', '\\o/', 'o.O', 'O.o', '\\.../', '\\ooo/', + ':\'(', + ':-!', + ':-/', + ':-[', + '8-)', + ':beer', + ':homebrew', + ':coffee', + ':facepalm', + ':headdesk', '~friendika ~friendika', '~friendica ~friendica', 'DiasporaDiaspora*', - ), $s); + ); - call_hooks('smilie', $s); + $params = array('texts' => $texts, 'icons' => $icons, 'string' => $s); + call_hooks('smilie', $params); + + if($sample) { + $s = '
    '; + for($x = 0; $x < count($params['texts']); $x ++) { + $s .= '
    ' . $params['texts'][$x] . '
    ' . $params['icons'][$x] . '
    '; + } + } + else { + $s = str_replace($params['texts'],$params['icons'],$params['string']); + } + return $s; }} @@ -785,10 +853,10 @@ function prepare_body($item,$attach = false) { case 'audio': case 'image': case 'text': - $icon = '
    '; + $icon = '
    '; break; default: - $icon = '
    '; + $icon = '
    '; break; } $title = ((strlen(trim($matches[4]))) ? escape_tags(trim($matches[4])) : escape_tags($matches[1])); @@ -814,7 +882,10 @@ function prepare_text($text) { require_once('include/bbcode.php'); - $s = smilies(bbcode($text)); + if(stristr($text,'[nosmile]')) + $s = bbcode($text); + else + $s = smilies(bbcode($text)); return $s; }} diff --git a/library/fullcalendar/GPL-LICENSE.txt b/library/fullcalendar/GPL-LICENSE.txt new file mode 100644 index 0000000000..11dddd00ef --- /dev/null +++ b/library/fullcalendar/GPL-LICENSE.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/library/fullcalendar/MIT-LICENSE.txt b/library/fullcalendar/MIT-LICENSE.txt new file mode 100644 index 0000000000..46d4754496 --- /dev/null +++ b/library/fullcalendar/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2009 Adam Shaw + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/library/fullcalendar/changelog.txt b/library/fullcalendar/changelog.txt new file mode 100644 index 0000000000..17b31f8622 --- /dev/null +++ b/library/fullcalendar/changelog.txt @@ -0,0 +1,318 @@ + +version 1.5.3 (2/6/12) + - fixed dragging issue with jQuery UI 1.8.16 (issue 1168) + - bundled with jQuery 1.7.1 and jQuery UI 1.8.17 + +version 1.5.2 (8/21/11) + - correctly process UTC "Z" ISO8601 date strings (issue 750) + +version 1.5.1 (4/9/11) + - more flexible ISO8601 date parsing (issue 814) + - more flexible parsing of UNIX timestamps (issue 826) + - FullCalendar now buildable from source on a Mac (issue 795) + - FullCalendar QA'd in FF4 (issue 883) + - upgraded to jQuery 1.5.2 (which supports IE9) and jQuery UI 1.8.11 + +version 1.5 (3/19/11) + - slicker default styling for buttons + - reworked a lot of the calendar's HTML and accompanying CSS + (solves issues 327 and 395) + - more printer-friendly (fullcalendar-print.css) + - fullcalendar now inherits styles from jquery-ui themes differently. + styles for buttons are distinct from styles for calendar cells. + (solves issue 299) + - can now color events through FullCalendar options and Event-Object properties (issue 117) + THIS IS NOW THE PREFERRED METHOD OF COLORING EVENTS (as opposed to using className and CSS) + - FullCalendar options: + - eventColor (changes both background and border) + - eventBackgroundColor + - eventBorderColor + - eventTextColor + - Event-Object options: + - color (changes both background and border) + - backgroundColor + - borderColor + - textColor + - can now specify an event source as an *object* with a `url` property (json feed) or + an `events` property (function or array) with additional properties that will + be applied to the entire event source: + - color (changes both background and border) + - backgroudColor + - borderColor + - textColor + - className + - editable + - allDayDefault + - ignoreTimezone + - startParam (for a feed) + - endParam (for a feed) + - ANY OF THE JQUERY $.ajax OPTIONS + allows for easily changing from GET to POST and sending additional parameters (issue 386) + allows for easily attaching ajax handlers such as `error` (issue 754) + allows for turning caching on (issue 355) + - Google Calendar feeds are now specified differently: + - specify a simple string of your feed's URL + - specify an *object* with a `url` property of your feed's URL. + you can include any of the new Event-Source options in this object. + - the old `$.fullCalendar.gcalFeed` method still works + - no more IE7 SSL popup (issue 504) + - remove `cacheParam` - use json event source `cache` option instead + - latest jquery/jquery-ui + +version 1.4.11 (2/22/11) + - fixed rerenderEvents bug (issue 790) + - fixed bug with faulty dragging of events from all-day slot in agenda views + - bundled with jquery 1.5 and jquery-ui 1.8.9 + +version 1.4.10 (1/2/11) + - fixed bug with resizing event to different week in 5-day month view (issue 740) + - fixed bug with events not sticking after a removeEvents call (issue 757) + - fixed bug with underlying parseTime method, and other uses of parseInt (issue 688) + +version 1.4.9 (11/16/10) + - new algorithm for vertically stacking events (issue 111) + - resizing an event to a different week (issue 306) + - bug: some events not rendered with consecutive calls to addEventSource (issue 679) + +version 1.4.8 (10/16/10) + - ignoreTimezone option (set to `false` to process UTC offsets in ISO8601 dates) + - bugfixes + - event refetching not being called under certain conditions (issues 417, 554) + - event refetching being called multiple times under certain conditions (issues 586, 616) + - selection cannot be triggered by right mouse button (issue 558) + - agenda view left axis sized incorrectly (issue 465) + - IE js error when calendar is too narrow (issue 517) + - agenda view looks strange when no scrollbars (issue 235) + - improved parsing of ISO8601 dates with UTC offsets + - $.fullCalendar.version + - an internal refactor of the code, for easier future development and modularity + +version 1.4.7 (7/5/10) + - "dropping" external objects onto the calendar + - droppable (boolean, to turn on/off) + - dropAccept (to filter which events the calendar will accept) + - drop (trigger) + - selectable options can now be specified with a View Option Hash + - bugfixes + - dragged & reverted events having wrong time text (issue 406) + - bug rendering events that have an endtime with seconds, but no hours/minutes (issue 477) + - gotoDate date overflow bug (issue 429) + - wrong date reported when clicking on edge of last column in agenda views (412) + - support newlines in event titles + - select/unselect callbacks now passes native js event + +version 1.4.6 (5/31/10) + - "selecting" days or timeslots + - options: selectable, selectHelper, unselectAuto, unselectCancel + - callbacks: select, unselect + - methods: select, unselect + - when dragging an event, the highlighting reflects the duration of the event + - code compressing by Google Closure Compiler + - bundled with jQuery 1.4.2 and jQuery UI 1.8.1 + +version 1.4.5 (2/21/10) + - lazyFetching option, which can force the calendar to fetch events on every view/date change + - scroll state of agenda views are preserved when switching back to view + - bugfixes + - calling methods on an uninitialized fullcalendar throws error + - IE6/7 bug where an entire view becomes invisible (issue 320) + - error when rendering a hidden calendar (in jquery ui tabs for example) in IE (issue 340) + - interconnected bugs related to calendar resizing and scrollbars + - when switching views or clicking prev/next, calendar would "blink" (issue 333) + - liquid-width calendar's events shifted (depending on initial height of browser) (issue 341) + - more robust underlying algorithm for calendar resizing + +version 1.4.4 (2/3/10) + - optimized event rendering in all views (events render in 1/10 the time) + - gotoDate() does not force the calendar to unnecessarily rerender + - render() method now correctly readjusts height + +version 1.4.3 (12/22/09) + - added destroy method + - Google Calendar event pages respect currentTimezone + - caching now handled by jQuery's ajax + - protection from setting aspectRatio to zero + - bugfixes + - parseISO8601 and DST caused certain events to display day before + - button positioning problem in IE6 + - ajax event source removed after recently being added, events still displayed + - event not displayed when end is an empty string + - dynamically setting calendar height when no events have been fetched, throws error + +version 1.4.2 (12/02/09) + - eventAfterRender trigger + - getDate & getView methods + - height & contentHeight options (explicitly sets the pixel height) + - minTime & maxTime options (restricts shown hours in agenda view) + - getters [for all options] and setters [for height, contentHeight, and aspectRatio ONLY! stay tuned..] + - render method now readjusts calendar's size + - bugfixes + - lightbox scripts that use iframes (like fancybox) + - day-of-week classNames were off when firstDay=1 + - guaranteed space on right side of agenda events (even when stacked) + - accepts ISO8601 dates with a space (instead of 'T') + +version 1.4.1 (10/31/09) + - can exclude weekends with new 'weekends' option + - gcal feed 'currentTimezone' option + - bugfixes + - year/month/date option sometimes wouldn't set correctly (depending on current date) + - daylight savings issue caused agenda views to start at 1am (for BST users) + - cleanup of gcal.js code + +version 1.4 (10/19/09) + - agendaWeek and agendaDay views + - added some options for agenda views: + - allDaySlot + - allDayText + - firstHour + - slotMinutes + - defaultEventMinutes + - axisFormat + - modified some existing options/triggers to work with agenda views: + - dragOpacity and timeFormat can now accept a "View Hash" (a new concept) + - dayClick now has an allDay parameter + - eventDrop now has an an allDay parameter + (this will affect those who use revertFunc, adjust parameter list) + - added 'prevYear' and 'nextYear' for buttons in header + - minor change for theme users, ui-state-hover not applied to active/inactive buttons + - added event-color-changing example in docs + - better defaults for right-to-left themed button icons + +version 1.3.2 (10/13/09) + - Bugfixes (please upgrade from 1.3.1!) + - squashed potential infinite loop when addMonths and addDays + is called with an invalid date + - $.fullCalendar.parseDate() now correctly parses IETF format + - when switching views, the 'today' button sticks inactive, fixed + - gotoDate now can accept a single Date argument + - documentation for changes in 1.3.1 and 1.3.2 now on website + +version 1.3.1 (9/30/09) + - Important Bugfixes (please upgrade from 1.3!) + - When current date was late in the month, for long months, and prev/next buttons + were clicked in month-view, some months would be skipped/repeated + - In certain time zones, daylight savings time would cause certain days + to be misnumbered in month-view + - Subtle change in way week interval is chosen when switching from month to basicWeek/basicDay view + - Added 'allDayDefault' option + - Added 'changeView' and 'render' methods + +version 1.3 (9/21/09) + - different 'views': month/basicWeek/basicDay + - more flexible 'header' system for buttons + - themable by jQuery UI themes + - resizable events (require jQuery UI resizable plugin) + - rescoped & rewritten CSS, enhanced default look + - cleaner css & rendering techniques for right-to-left + - reworked options & API to support multiple views / be consistent with jQuery UI + - refactoring of entire codebase + - broken into different JS & CSS files, assembled w/ build scripts + - new test suite for new features, uses firebug-lite + - refactored docs + - Options + + date + + defaultView + + aspectRatio + + disableResizing + + monthNames (use instead of $.fullCalendar.monthNames) + + monthNamesShort (use instead of $.fullCalendar.monthAbbrevs) + + dayNames (use instead of $.fullCalendar.dayNames) + + dayNamesShort (use instead of $.fullCalendar.dayAbbrevs) + + theme + + buttonText + + buttonIcons + x draggable -> editable/disableDragging + x fixedWeeks -> weekMode + x abbrevDayHeadings -> columnFormat + x buttons/title -> header + x eventDragOpacity -> dragOpacity + x eventRevertDuration -> dragRevertDuration + x weekStart -> firstDay + x rightToLeft -> isRTL + x showTime (use 'allDay' CalEvent property instead) + - Triggered Actions + + eventResizeStart + + eventResizeStop + + eventResize + x monthDisplay -> viewDisplay + x resize -> windowResize + 'eventDrop' params changed, can revert if ajax cuts out + - CalEvent Properties + x showTime -> allDay + x draggable -> editable + 'end' is now INCLUSIVE when allDay=true + 'url' now produces a real tag, more native clicking/tab behavior + - Methods: + + renderEvent + x prevMonth -> prev + x nextMonth -> next + x prevYear/nextYear -> moveDate + x refresh -> rerenderEvents/refetchEvents + x removeEvent -> removeEvents + x getEventsByID -> clientEvents + - Utilities: + 'formatDate' format string completely changed (inspired by jQuery UI datepicker + datejs) + 'formatDates' added to support date-ranges + - Google Calendar Options: + x draggable -> editable + - Bugfixes + - gcal extension fetched 25 results max, now fetches all + +version 1.2.1 (6/29/09) + - bugfixes + - allows and corrects invalid end dates for events + - doesn't throw an error in IE while rendering when display:none + - fixed 'loading' callback when used w/ multiple addEventSource calls + - gcal className can now be an array + +version 1.2 (5/31/09) + - expanded API + - 'className' CalEvent attribute + - 'source' CalEvent attribute + - dynamically get/add/remove/update events of current month + - locale improvements: change month/day name text + - better date formatting ($.fullCalendar.formatDate) + - multiple 'event sources' allowed + - dynamically add/remove event sources + - options for prevYear and nextYear buttons + - docs have been reworked (include addition of Google Calendar docs) + - changed behavior of parseDate for number strings + (now interpets as unix timestamp, not MS times) + - bugfixes + - rightToLeft month start bug + - off-by-one errors with month formatting commands + - events from previous months sticking when clicking prev/next quickly + - Google Calendar API changed to work w/ multiple event sources + - can also provide 'className' and 'draggable' options + - date utilties moved from $ to $.fullCalendar + - more documentation in source code + - minified version of fullcalendar.js + - test suit (available from svn) + - top buttons now use