diff --git a/boot.php b/boot.php index e0b768171..170c9953b 100644 --- a/boot.php +++ b/boot.php @@ -11,7 +11,7 @@ require_once('include/cache.php'); require_once('library/Mobile_Detect/Mobile_Detect.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '3.0.1419' ); +define ( 'FRIENDICA_VERSION', '3.0.1423' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1155 ); diff --git a/database.sql b/database.sql index 80ce05ba0..fa4f1bd58 100644 --- a/database.sql +++ b/database.sql @@ -570,6 +570,9 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `moderated` (`moderated`), KEY `spam` (`spam`), KEY `author-name` (`author-name`), + KEY `uid_commented` (`uid`, `commented`), + KEY `uid_created` (`uid`, `created`), + KEY `uid_unseen` (`uid`, `unseen`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `body` (`body`), FULLTEXT KEY `allow_cid` (`allow_cid`), diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index b95dee8f3..9ede42f6c 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -202,9 +202,9 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { // the following was added on 10-January-2012 due to an inability of Diaspora's // new javascript markdown processor to handle links with images as the link "text" // It is not optimal and may be removed if this ability is restored in the future - if ($fordiaspora) - $Text = preg_replace("/\[url\=([^\[\]]*)\]\s*\[img\](.*?)\[\/img\]\s*\[\/url\]/ism", - "[url]$1[/url]\n[img]$2[/img]", $Text); + //if ($fordiaspora) + // $Text = preg_replace("/\[url\=([^\[\]]*)\]\s*\[img\](.*?)\[\/img\]\s*\[\/url\]/ism", + // "[url]$1[/url]\n[img]$2[/img]", $Text); // Convert it to HTML - don't try oembed $Text = bbcode($Text, $preserve_nl, false); diff --git a/include/bbcode.php b/include/bbcode.php index 9ece3c3de..d83cd3581 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -224,6 +224,12 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // Check for list text $Text = str_replace("[*]", "
  • ", $Text); + // Check for style sheet commands + $Text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism","$2",$Text); + + // Check for CSS classes + $Text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism","$2",$Text); + // handle nested lists $endlessloop = 0; diff --git a/include/markdownify/markdownify.php b/include/markdownify/markdownify.php index 7bbf1cbbe..0d4429a01 100644 --- a/include/markdownify/markdownify.php +++ b/include/markdownify/markdownify.php @@ -686,6 +686,10 @@ class Markdownify { # [1]: mailto:mail@example.com Title $tag['href'] = 'mailto:'.$bufferDecoded; } + + $this->out('['.$buffer.']('.$tag['href'].' "'.$tag['title'].'")', true); + +/* # [This link][id] foreach ($this->stack['a'] as $tag2) { if ($tag2['href'] == $tag['href'] && $tag2['title'] === $tag['title']) { @@ -699,6 +703,7 @@ class Markdownify { } $this->out('['.$buffer.']['.$tag['linkID'].']', true); +*/ } } /** @@ -737,7 +742,7 @@ class Markdownify { // ![Alt text](/path/to/img.jpg "Optional title") if ($this->parser->tagAttributes['title'] != "") - $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['src'].'"'.$this->parser->tagAttributes['title'].'")', true); + $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['src'].' "'.$this->parser->tagAttributes['title'].'")', true); else $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['src'].')', true); diff --git a/include/network.php b/include/network.php index a95dde535..0fff5c7cc 100644 --- a/include/network.php +++ b/include/network.php @@ -802,7 +802,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $s = htmlspecialchars_decode($s); $matches = null; - $c = preg_match_all('/\[img\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER); + $c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER); if($c) { require_once('include/Photo.php'); foreach($matches as $mtch) { @@ -823,6 +823,12 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $scaled = $mtch[1]; $i = fetch_url($scaled); + $cache = get_config('system','itemcache'); + if (($cache != '') and is_dir($cache)) { + $cachefile = $cache."/".hash("md5", $scaled); + file_put_contents($cachefile, $i); + } + // guess mimetype from headers or filename $type = guess_image_type($mtch[1],true); diff --git a/include/text.php b/include/text.php index 41030e677..1c50086aa 100644 --- a/include/text.php +++ b/include/text.php @@ -1578,7 +1578,7 @@ function undo_post_tagging($s) { function fix_mce_lf($s) { $s = str_replace("\r\n","\n",$s); - $s = str_replace("\n\n","\n",$s); +// $s = str_replace("\n\n","\n",$s); return $s; } diff --git a/mod/display.php b/mod/display.php index 81ed174ac..92ffd1a70 100644 --- a/mod/display.php +++ b/mod/display.php @@ -16,15 +16,7 @@ function display_content(&$a) { $o = '
    ' . "\r\n"; - $a->page['htmlhead'] .= << -$(document).ready(function() { - $(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl"); - // make auto-complete work in more places - $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); -}); - -EOT; + $a->page['htmlhead'] .= get_markup_template('display-head.tpl'); $nick = (($a->argc > 1) ? $a->argv[1] : ''); @@ -126,7 +118,7 @@ EOT; } else { - $r = q("SELECT `id` FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1", + $r = q("SELECT `id`,`deleted` FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1", dbesc($item_id), dbesc($item_id) ); diff --git a/mod/parse_url.php b/mod/parse_url.php index 5dd7de750..ea05055f0 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -176,6 +176,9 @@ function parseurl_getsiteinfo($url) { } } else { $src = completeurl($siteinfo["image"], $url); + + unset($siteinfo["image"]); + $photodata = getimagesize($src); if (($photodata[0] > 10) and ($photodata[1] > 10)) @@ -292,8 +295,7 @@ function parse_url_content(&$a) { $siteinfo = parseurl_getsiteinfo($url); if($siteinfo["title"] == "") { - echo print_r($siteinfo, true); - //echo sprintf($template,$url,$url,'') . $str_tags; + echo sprintf($template,$url,$url,'') . $str_tags; killme(); } else { $text = $siteinfo["text"]; @@ -302,7 +304,7 @@ function parse_url_content(&$a) { $image = ""; - if($siteinfo["image"] != ""){ + if(sizeof($siteinfo["images"]) > 0){ /* Execute below code only if image is present in siteinfo */ diff --git a/mod/poke.php b/mod/poke.php index 085415a76..5cd88d7e2 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -27,8 +27,8 @@ function poke_init(&$a) { if(! $contact_id) return; + $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0); - $private = ((x($_GET,'private')) ? intval($_GET['private']) : 0); logger('poke: verb ' . $verb . ' contact ' . $contact_id, LOGGER_DEBUG); @@ -45,6 +45,32 @@ function poke_init(&$a) { $target = $r[0]; + if($parent) { + $r = q("select uri, private, allow_cid, allow_gid, deny_cid, deny_gid + from item where id = %d and parent = %d and uid = %d limit 1", + intval($parent), + intval($parent), + intval($uid) + ); + if(count($r)) { + $parent_uri = $r[0]['uri']; + $private = $r[0]['private']; + $allow_cid = $r[0]['allow_cid']; + $allow_gid = $r[0]['allow_gid']; + $deny_cid = $r[0]['deny_cid']; + $deny_gid = $r[0]['deny_gid']; + } + } + else { + + $private = ((x($_GET,'private')) ? intval($_GET['private']) : 0); + + $allow_cid = (($private) ? '<' . $target['id']. '>' : $a->user['allow_cid']); + $allow_gid = (($private) ? '' : $a->user['allow_gid']); + $deny_cid = (($private) ? '' : $a->user['deny_cid']); + $deny_gid = (($private) ? '' : $a->user['deny_gid']); + } + $poster = $a->contact; $uri = item_new_uri($a->get_hostname(),$owner_uid); @@ -53,7 +79,7 @@ function poke_init(&$a) { $arr['uid'] = $uid; $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; + $arr['parent-uri'] = (($parent_uri) ? $parent_uri : $uri); $arr['type'] = 'activity'; $arr['wall'] = 1; $arr['contact-id'] = $poster['id']; @@ -64,10 +90,10 @@ function poke_init(&$a) { $arr['author-link'] = $poster['url']; $arr['author-avatar'] = $poster['thumb']; $arr['title'] = ''; - $arr['allow_cid'] = (($private) ? '<' . $target['id']. '>' : $a->user['allow_cid']); - $arr['allow_gid'] = (($private) ? '' : $a->user['allow_gid']); - $arr['deny_cid'] = (($private) ? '' : $a->user['deny_cid']); - $arr['deny_gid'] = (($private) ? '' : $a->user['deny_gid']); + $arr['allow_cid'] = $allow_cid; + $arr['allow_gid'] = $allow_gid; + $arr['deny_cid'] = $deny_cid; + $arr['deny_gid'] = $deny_gid; $arr['last-child'] = 1; $arr['visible'] = 1; $arr['verb'] = $activity; @@ -132,12 +158,12 @@ function poke_content(&$a) { EOT; + $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0'); + + $verbs = get_poke_verbs(); @@ -165,6 +194,7 @@ EOT; '$clabel' => t('Recipient'), '$choice' => t('Choose what you wish to do to recipient'), '$verbs' => $shortlist, + '$parent' => $parent, '$prv_desc' => t('Make this post private'), '$submit' => t('Submit'), '$name' => $name, diff --git a/mods/readme.txt b/mods/readme.txt new file mode 100644 index 000000000..9e79f843f --- /dev/null +++ b/mods/readme.txt @@ -0,0 +1,5 @@ +Site speed can be improved when the following indexes are set. They cannot be set through the update script because on large sites they will block the site for several minutes. + +CREATE INDEX `uid_commented` ON `item` (`uid`, `commented`); +CREATE INDEX `uid_created` ON `item` (`uid`, `created`); +CREATE INDEX `uid_unseen` ON `item` (`uid`, `unseen`); diff --git a/update.php b/update.php index 789ff9f45..c41acf6fb 100644 --- a/update.php +++ b/update.php @@ -1350,4 +1350,3 @@ function update_1154() { if(!$r) return UPDATE_FAILED; return UPDATE_SUCCESS; } - diff --git a/util/messages.po b/util/messages.po index 02a072cae..86bf30b50 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 3.0.1419\n" +"Project-Id-Version: 3.0.1423\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-07-29 10:00-0700\n" +"POT-Creation-Date: 2012-08-02 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,7 +37,7 @@ msgstr "" #: ../../mod/crepair.php:115 ../../mod/wall_attach.php:44 #: ../../mod/fsuggest.php:78 ../../mod/events.php:140 ../../mod/api.php:26 #: ../../mod/api.php:31 ../../mod/photos.php:116 ../../mod/photos.php:938 -#: ../../mod/editpost.php:10 ../../mod/install.php:151 ../../mod/poke.php:109 +#: ../../mod/editpost.php:10 ../../mod/install.php:151 ../../mod/poke.php:135 #: ../../mod/notifications.php:66 ../../mod/contacts.php:139 #: ../../mod/settings.php:86 ../../mod/settings.php:519 #: ../../mod/settings.php:524 ../../mod/manage.php:86 ../../mod/network.php:6 @@ -51,7 +51,7 @@ msgstr "" #: ../../mod/profile_photo.php:166 ../../mod/message.php:38 #: ../../mod/message.php:168 ../../mod/allfriends.php:9 #: ../../mod/nogroup.php:25 ../../mod/wall_upload.php:53 -#: ../../mod/follow.php:9 ../../mod/display.php:138 ../../mod/profiles.php:7 +#: ../../mod/follow.php:9 ../../mod/display.php:130 ../../mod/profiles.php:7 #: ../../mod/profiles.php:408 ../../mod/delegate.php:6 #: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81 #: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:510 @@ -127,7 +127,7 @@ msgstr "" #: ../../mod/photos.php:1285 ../../mod/photos.php:1325 #: ../../mod/photos.php:1365 ../../mod/photos.php:1396 #: ../../mod/install.php:246 ../../mod/install.php:284 -#: ../../mod/localtime.php:45 ../../mod/poke.php:169 ../../mod/content.php:691 +#: ../../mod/localtime.php:45 ../../mod/poke.php:199 ../../mod/content.php:691 #: ../../mod/contacts.php:341 ../../mod/settings.php:537 #: ../../mod/settings.php:691 ../../mod/settings.php:752 #: ../../mod/settings.php:958 ../../mod/group.php:85 ../../mod/message.php:294 @@ -742,6 +742,10 @@ msgstr "" msgid "Example: bob@example.com, mary@example.com" msgstr "" +#: ../../mod/editpost.php:135 ../../include/conversation.php:1166 +msgid "Friendica mobile web" +msgstr "" + #: ../../mod/dfrn_request.php:93 msgid "This introduction has already been accepted." msgstr "" @@ -1218,23 +1222,23 @@ msgstr "" msgid "Please select your timezone:" msgstr "" -#: ../../mod/poke.php:163 +#: ../../mod/poke.php:192 msgid "Poke/Prod" msgstr "" -#: ../../mod/poke.php:164 +#: ../../mod/poke.php:193 msgid "poke, prod or do other things to somebody" msgstr "" -#: ../../mod/poke.php:165 +#: ../../mod/poke.php:194 msgid "Recipient" msgstr "" -#: ../../mod/poke.php:166 +#: ../../mod/poke.php:195 msgid "Choose what you wish to do to recipient" msgstr "" -#: ../../mod/poke.php:168 +#: ../../mod/poke.php:198 msgid "Make this post private" msgstr "" @@ -2598,7 +2602,7 @@ msgstr "" #: ../../mod/notes.php:63 ../../mod/filer.php:30 #: ../../addon/facebook/facebook.php:770 -#: ../../addon/privacy_image_cache/privacy_image_cache.php:236 +#: ../../addon/privacy_image_cache/privacy_image_cache.php:263 #: ../../addon/dav/layout.fnk.php:441 ../../addon/dav/layout.fnk.php:488 #: ../../include/text.php:677 msgid "Save" @@ -2982,8 +2986,8 @@ msgid "%1$s doesn't like %2$s's %3$s" msgstr "" #: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159 -#: ../../mod/admin.php:705 ../../mod/admin.php:904 ../../mod/display.php:37 -#: ../../mod/display.php:142 ../../include/items.php:3692 +#: ../../mod/admin.php:705 ../../mod/admin.php:904 ../../mod/display.php:29 +#: ../../mod/display.php:134 ../../include/items.php:3692 msgid "Item not found." msgstr "" @@ -3807,7 +3811,7 @@ msgstr "" msgid "Requested profile is not available." msgstr "" -#: ../../mod/profile.php:141 ../../mod/display.php:75 +#: ../../mod/profile.php:141 ../../mod/display.php:67 msgid "Access to this profile has been restricted." msgstr "" @@ -3894,7 +3898,7 @@ msgstr "" msgid "link" msgstr "" -#: ../../mod/display.php:135 +#: ../../mod/display.php:127 msgid "Item has been removed." msgstr "" @@ -4783,23 +4787,23 @@ msgstr "" msgid "How many contacts to display on profile sidebar" msgstr "" -#: ../../addon/privacy_image_cache/privacy_image_cache.php:233 +#: ../../addon/privacy_image_cache/privacy_image_cache.php:260 msgid "Lifetime of the cache (in hours)" msgstr "" -#: ../../addon/privacy_image_cache/privacy_image_cache.php:238 +#: ../../addon/privacy_image_cache/privacy_image_cache.php:265 msgid "Cache Statistics" msgstr "" -#: ../../addon/privacy_image_cache/privacy_image_cache.php:241 +#: ../../addon/privacy_image_cache/privacy_image_cache.php:268 msgid "Number of items" msgstr "" -#: ../../addon/privacy_image_cache/privacy_image_cache.php:243 +#: ../../addon/privacy_image_cache/privacy_image_cache.php:270 msgid "Size of the cache" msgstr "" -#: ../../addon/privacy_image_cache/privacy_image_cache.php:245 +#: ../../addon/privacy_image_cache/privacy_image_cache.php:272 msgid "Delete the whole cache" msgstr "" @@ -7500,7 +7504,7 @@ msgstr "" msgid "Attachments:" msgstr "" -#: ../../include/network.php:843 +#: ../../include/network.php:849 msgid "view full size" msgstr "" @@ -7799,11 +7803,11 @@ msgstr "" msgid "From: " msgstr "" -#: ../../include/bbcode.php:102 ../../include/bbcode.php:317 +#: ../../include/bbcode.php:102 ../../include/bbcode.php:323 msgid "Image/photo" msgstr "" -#: ../../include/bbcode.php:282 ../../include/bbcode.php:302 +#: ../../include/bbcode.php:288 ../../include/bbcode.php:308 msgid "$1 wrote:" msgstr "" diff --git a/view/birthdays_reminder.tpl b/view/birthdays_reminder.tpl index a00e5c7f8..8db7d22f4 100644 --- a/view/birthdays_reminder.tpl +++ b/view/birthdays_reminder.tpl @@ -5,6 +5,6 @@ {{ for $events as $event }}
    $event.title $event.date
    {{ endfor }} - + {{ endif }} diff --git a/view/display-head.tpl b/view/display-head.tpl new file mode 100644 index 000000000..3d4e7e96a --- /dev/null +++ b/view/display-head.tpl @@ -0,0 +1,8 @@ + + diff --git a/view/events_reminder.tpl b/view/events_reminder.tpl index fe7e33980..f641a5faf 100644 --- a/view/events_reminder.tpl +++ b/view/events_reminder.tpl @@ -5,6 +5,6 @@ {{ for $events as $event }}
    $event.title $event.date
    {{ endfor }} - + {{ endif }} diff --git a/view/invite.tpl b/view/invite.tpl index 01a45c774..a47ef0162 100644 --- a/view/invite.tpl +++ b/view/invite.tpl @@ -23,4 +23,5 @@ $msg_text - \ No newline at end of file + + diff --git a/view/photos_upload.tpl b/view/photos_upload.tpl index c20028296..2a820d9c7 100644 --- a/view/photos_upload.tpl +++ b/view/photos_upload.tpl @@ -28,6 +28,7 @@ $permissions +
    diff --git a/view/poke_content.tpl b/view/poke_content.tpl index 18438787a..b9e089f5b 100644 --- a/view/poke_content.tpl +++ b/view/poke_content.tpl @@ -8,9 +8,9 @@
    $clabel

    - - - + + +

    $choice
    @@ -24,7 +24,7 @@

    $prv_desc
    - +

    diff --git a/view/theme/darkzero-NS/style.css b/view/theme/darkzero-NS/style.css index 5d1bb6310..8d106bdc9 100644 --- a/view/theme/darkzero-NS/style.css +++ b/view/theme/darkzero-NS/style.css @@ -49,7 +49,7 @@ background: #444; color: #99CCFF; } -.wall-item-photo-menu li a { +.wall-item-photo-menu li a, .contact-photo-menu { color: #CCCCCC; background-color: #333333; } diff --git a/view/theme/darkzero/style.css b/view/theme/darkzero/style.css index 55644e462..483820870 100644 --- a/view/theme/darkzero/style.css +++ b/view/theme/darkzero/style.css @@ -49,7 +49,7 @@ background: #444; color: #99CCFF; } -.wall-item-photo-menu li a { +.wall-item-photo-menu li a, .contact-photo-menu { color: #CCCCCC; background-color: #333333; } diff --git a/view/theme/diabook/style-profile.css b/view/theme/diabook/style-profile.css index 63b2eb544..927549fa3 100644 --- a/view/theme/diabook/style-profile.css +++ b/view/theme/diabook/style-profile.css @@ -2549,4 +2549,9 @@ list-style-type: disc; #photos-upload-newalbum-div { float: left; width: 175px; -} \ No newline at end of file +} + +.item-image-preview { + float: left; + margin-right: 10px; +} diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 68bfd5d3a..286559b85 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -2906,4 +2906,4 @@ list-style-type: disc; #photos-upload-newalbum-div { float: left; width: 175px; -} \ No newline at end of file +} diff --git a/view/theme/frost-mobile/TODO b/view/theme/frost-mobile/TODO index 691154c3c..cc35b6305 100644 --- a/view/theme/frost-mobile/TODO +++ b/view/theme/frost-mobile/TODO @@ -14,8 +14,10 @@ Photo album display? - Admin: access to more pages than summary? +- Embedded video playback is way too big + - Needs to be faster! - - Reduce DOM elements (4100 for 10 items) + - Reduce DOM elements (~2400 for 10 items, ~8400 for 40 items) - Automatically set limit of 10 items for Network and Profile? diff --git a/view/theme/frost-mobile/comment_item.tpl b/view/theme/frost-mobile/comment_item.tpl index 8fb578369..b5b0e9d28 100755 --- a/view/theme/frost-mobile/comment_item.tpl +++ b/view/theme/frost-mobile/comment_item.tpl @@ -19,10 +19,10 @@ -
    - $mytitle -
    -
    + + $mytitle + +
    • -->
    -
    + {{ if $qcomment }} @@ -68,7 +68,7 @@ -->
    -
    + diff --git a/view/theme/frost-mobile/display-head.tpl b/view/theme/frost-mobile/display-head.tpl new file mode 100644 index 000000000..1fc82ae77 --- /dev/null +++ b/view/theme/frost-mobile/display-head.tpl @@ -0,0 +1,4 @@ + + diff --git a/view/theme/frost-mobile/jot-header.tpl b/view/theme/frost-mobile/jot-header.tpl index d409edea4..66a2c8796 100644 --- a/view/theme/frost-mobile/jot-header.tpl +++ b/view/theme/frost-mobile/jot-header.tpl @@ -1,5 +1,6 @@ + diff --git a/view/theme/frost/jot-header.tpl b/view/theme/frost/jot-header.tpl index dfcfc68af..16fd47317 100644 --- a/view/theme/frost/jot-header.tpl +++ b/view/theme/frost/jot-header.tpl @@ -1,5 +1,6 @@