| | |
| | | * @param string $type |
| | | * @return string |
| | | */ |
| | | function jvbRenderLinks(int $ID, string $type =''):string |
| | | function jvbRenderLinks(int $ID, string $type ='post'):string |
| | | { |
| | | $cache = Cache::for('user_links', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy')->connect('user'); |
| | | $cache = Cache::for('user_links_'.$type, $type,WEEK_IN_SECONDS); |
| | | $cached = $cache->get($ID); |
| | | if ($cached) { |
| | | return $cached; |
| | |
| | | |
| | | /** |
| | | * @param int $ID |
| | | * @param string $type |
| | | * @param ?string $type |
| | | * |
| | | * @return string |
| | | */ |
| | | function jvbRenderContactInfo(int $ID, string $type = ''):string |
| | | function jvbRenderContactInfo(int $ID, ?string $type = null):string |
| | | { |
| | | $cache = Cache::for('contact', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy'); |
| | | if (is_null($type)) { |
| | | return ''; |
| | | } |
| | | $cache = Cache::for('contact_'.$type, $type,WEEK_IN_SECONDS); |
| | | |
| | | $cached = $cache->get($ID); |
| | | if($cached){ |
| | |
| | | return ''; |
| | | } |
| | | } |
| | | $cache = Cache::for($term->taxonomy.'_link')->connect('taxonomy'); |
| | | $cache = Cache::for($term->taxonomy.'_link', 'term'); |
| | | $key = $term->term_id; |
| | | return $cache->remember( |
| | | $key, |
| | |
| | | return ''; |
| | | } |
| | | |
| | | $cache = Cache::for('locations')->connect('taxonomy'); |
| | | $key = $cache->generateKey($location); |
| | | $cache = Cache::for('tax_locations', 'term'); |
| | | |
| | | $cached = $cache->get($location); |
| | | $cached = false; |
| | | if ($cached) { |
| | | return $cached; |
| | |
| | | ); |
| | | |
| | | $cached = '<p class="find-us">'.jvbIcon('map-pin').'Find us here: '.$google.$apple.'</p>'; |
| | | $cache->set($key, $cached); |
| | | $cache->set($location, $cached); |
| | | |
| | | return $cached; |
| | | } |