streams/Zotlabs/Daemon/Cache_embeds.php
2020-08-16 21:55:59 -07:00

34 lines
635 B
PHP

<?php
namespace Zotlabs\Daemon;
class Cache_embeds {
static public function run($argc,$argv) {
if (! $argc == 2) {
return;
}
$c = q("select body, html, created from item where id = %d ",
dbesc(intval($argv[1]))
);
if (! $c) {
return;
}
$item = array_shift($c);
$cache_expire = intval(get_config('system', 'default_expire_days'));
if ($cache_expire <= 0) {
$cache_expire = 60;
}
$cache_enable = ((($cache_expire) && ($item['created'] < datetime_convert('UTC','UTC', 'now - ' . $cache_expire . ' days'))) ? false : true);
$s = bbcode($item['body']);
$s = sslify($s, $cache_enable);
}
}