]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #1393 from annando/1502-cleaned-item-storage-code
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sat, 14 Feb 2015 14:40:35 +0000 (15:40 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sat, 14 Feb 2015 14:40:35 +0000 (15:40 +0100)
Additional check for notifications

1  2 
include/text.php

diff --combined include/text.php
index 535c36d235f0fe81ac87c03def37bf9b937df46d,a9edbf7611620e9863be14afd5b7771fbbbfbf1e..c33dd79952d8015dc38583e495ef93c9a89583de
@@@ -385,18 -385,6 +385,18 @@@ function alt_pager(&$a, $i) 
  
  }}
  
 +if(! function_exists('scroll_loader')) {
 +/**
 + * Loader for infinite scrolling
 + * @return string html for loader
 + */
 +function scroll_loader() {
 +      $tpl = get_markup_template("scroll_loader.tpl");
 +      return replace_macros($tpl, array(
 +              'wait' => t('Loading more entries...'),
 +              'end' => t('The end')
 +      ));
 +}}
  
  if(! function_exists('expand_acl')) {
  /**
@@@ -1293,6 -1281,18 +1293,18 @@@ function redir_private_images($a, &$ite
  
  }}
  
+ function put_item_in_cache($item) {
+       $cachefile = get_cachefile(urlencode($item["guid"])."-".hash("md5", $item['body']));
+       if (($cachefile != '') AND !file_exists($cachefile)) {
+               $s = prepare_text($item['body']);
+               $a = get_app();
+               $stamp1 = microtime(true);
+               file_put_contents($cachefile, $s);
+               $a->save_timestamp($stamp1, "file");
+               logger('put item '.$item["guid"].' into cachefile '.$cachefile);
+       }
+ }
  
  // Given an item array, convert the body element from bbcode to html and add smilie icons.
  // If attach is true, also add icons for item attachments