| | |
| | | */ |
| | | function jvbFormatRating(int $ID, JVBase\meta\MetaManager|null $meta = null):string |
| | | { |
| | | $cache = CacheManager::for('bio-'.$ID, WEEK_IN_SECONDS); |
| | | $key = 'rating'; |
| | | $cached = $cache->get($key); |
| | | $cache = CacheManager::for('rating', WEEK_IN_SECONDS)->connectTo('post')->connectTo('term'); |
| | | |
| | | $cached = $cache->get($ID); |
| | | $cached = false; |
| | | if ($cached) { |
| | | return $cached; |
| | |
| | | $out .= jvbFormatStarRating($avg, (int)$total); |
| | | } |
| | | |
| | | $cache->set($key, $out); |
| | | $cache->set($ID, $out); |
| | | return $out; |
| | | } |
| | | |
| | |
| | | */ |
| | | function jvbImageData(int $imgID):array |
| | | { |
| | | $cache = CacheManager::for('imageData', WEEK_IN_SECONDS); |
| | | $cache = CacheManager::for('imageData', WEEK_IN_SECONDS)->connectTo('post'); |
| | | $cached = $cache->get($imgID); |
| | | if ($cached) { |
| | | return $cached; |