diff --git a/.gitignore b/.gitignore
index 358114a44..038ac32a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,11 @@ report/
#ignore OSX .DS_Store files
.DS_Store
-/nbproject/private/
\ No newline at end of file
+/nbproject/private/
+
+#ignore smarty cache
+/view/smarty3/compiled/
+
+#ignore cache folders
+/privacy_image_cache/
+/photo/
diff --git a/include/api.php b/include/api.php
index 03514ecd5..2c5ddc626 100644
--- a/include/api.php
+++ b/include/api.php
@@ -944,7 +944,7 @@
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`nick` as `reply_author`,
- `contact`.`name`, `contact`.`photo`, `contact`.`url` as `reply_url`, `contact`.`rel`,
+ `contact`.`name`, `contact`.`photo` as `reply_photo`, `contact`.`url` as `reply_url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item`, `contact`
@@ -957,7 +957,18 @@
);
if ($r[0]['body'] != "") {
- $_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
+ if (intval(get_config('system','new_share'))) {
+ $post = "[share author='".str_replace("'", "'", $r[0]['reply_author']).
+ "' profile='".$r[0]['reply_url'].
+ "' avatar='".$r[0]['reply_photo'].
+ "' link='".$r[0]['plink']."']";
+
+ $post .= $r[0]['body'];
+ $post .= "[/share]";
+ $_REQUEST['body'] = $post;
+ } else
+ $_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
+
$_REQUEST['profile_uid'] = api_user();
$_REQUEST['type'] = 'wall';
$_REQUEST['api_source'] = true;
diff --git a/include/bbcode.php b/include/bbcode.php
index 384fd5ebd..08edc1934 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -310,6 +310,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// remove some newlines before the general conversion
$Text = preg_replace("/\s?\[share(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism","[share$1]$2[/share]",$Text);
+ $Text = preg_replace("/\s?\[quote(.*?)\]\s?(.*?)\s?\[\/quote\]\s?/ism","[quote$1]$2[/quote]",$Text);
// when the content is meant exporting to other systems then remove the avatar picture since this doesn't really look good on these systems
if (!$tryoembed)
@@ -324,6 +325,15 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = trim($Text);
$Text = str_replace("\r\n","\n", $Text);
+
+ // removing multiplicated newlines
+ $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]");
+ $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]");
+ do {
+ $oldtext = $Text;
+ $Text = str_replace($search, $replace, $Text);
+ } while ($oldtext != $Text);
+
$Text = str_replace(array("\r","\n"), array('
','
'), $Text);
if($preserve_nl)
diff --git a/include/poller.php b/include/poller.php
index 6bca5872f..7df59f727 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -99,14 +99,26 @@ function poller_run(&$argv, &$argc){
proc_run('php','include/expire.php');
}
- // clear old cache
- Cache::clear();
+ $last = get_config('system','cache_last_cleared');
- // clear old item cache files
- clear_cache();
+ if($last) {
+ $next = $last + (3600); // Once per hour
+ $clear_cache = ($next <= time());
+ } else
+ $clear_cache = true;
- // clear cache for photos
- clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
+ if ($clear_cache) {
+ // clear old cache
+ Cache::clear();
+
+ // clear old item cache files
+ clear_cache();
+
+ // clear cache for photos
+ clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
+
+ set_config('system','cache_last_cleared', time());
+ }
$manual_id = 0;
$generation = 0;
diff --git a/object/Item.php b/object/Item.php
index eef8a5058..0ea9954b0 100644
--- a/object/Item.php
+++ b/object/Item.php
@@ -115,10 +115,10 @@ class Item extends BaseObject {
$drop = array(
'dropping' => $dropping,
'pagedrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $item['pagedrop'] : ''),
- 'select' => t('Select'),
+ 'select' => t('Select'),
'delete' => t('Delete'),
);
-
+
$filer = (($conv->get_profile_owner() == local_user()) ? t("save to folder") : false);
$diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
@@ -133,7 +133,7 @@ class Item extends BaseObject {
if($sp)
$sparkle = ' sparkle';
else
- $profile_link = zrl($profile_link);
+ $profile_link = zrl($profile_link);
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
@@ -212,9 +212,14 @@ class Item extends BaseObject {
localize_item($item);
+ if ($item["postopts"]) {
+ $langdata = explode(";", $item["postopts"]);
+ $langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)";
+ }
+
$body = prepare_body($item,true);
- list($categories, $folders) = get_cats_and_terms($item);
+ list($categories, $folders) = get_cats_and_terms($item);
if($a->theme['template_engine'] === 'internal') {
$body_e = template_escape($body);
@@ -235,7 +240,7 @@ class Item extends BaseObject {
$tmp_item = array(
'template' => $this->get_template(),
-
+
'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'tags' => $tags,
'hashtags' => $hashtags,
@@ -285,7 +290,8 @@ class Item extends BaseObject {
'comment' => $this->get_comment_box($indent),
'previewing' => ($conv->is_preview() ? ' preview ' : ''),
'wait' => t('Please wait'),
- 'thread_level' => $thread_level
+ 'thread_level' => $thread_level,
+ 'postopts' => $langstr
);
$arr = array('item' => $item, 'output' => $tmp_item);
diff --git a/view/theme/vier/profile_edlink.tpl b/view/theme/vier/profile_edlink.tpl
new file mode 100644
index 000000000..5bdbb834a
--- /dev/null
+++ b/view/theme/vier/profile_edlink.tpl
@@ -0,0 +1 @@
+