| | |
| | | <?php |
| | | namespace JVBase; |
| | | |
| | | use JVBase\meta\MetaManager; |
| | | use JVBase\meta\Meta; |
| | | use WP_User; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | |
| | | protected int $user_id; |
| | | protected int $profileID; |
| | | protected WP_User $user_data; |
| | | protected MetaManager $meta; |
| | | protected Meta $meta; |
| | | protected string $base_url = 'https://edmonton.ink'; |
| | | protected string $badge_url; |
| | | |
| | |
| | | $this->user_id = $user_id; |
| | | $this->profileID = get_user_meta($user_id, BASE . 'link', true); |
| | | $this->user_data = get_userdata($user_id); |
| | | $this->meta = new MetaManager($this->profileID, 'post'); |
| | | |
| | | $this->meta = Meta::forPost($this->profileID); |
| | | |
| | | // Set badge URL - this would be your badge image path |
| | | $this->badge_url = JVB_URL . 'assets/images/badges/edmonton-ink-badge.png'; |
| | |
| | | $legacy_url = 'https://legacytattooremoval.ca'; |
| | | |
| | | // Build HTML with structured data for SEO |
| | | $html = <<<HTML |
| | | return <<<HTML |
| | | <!-- edmonton.ink Artist Badge - Start --> |
| | | <div id="$container_id" class="jvb-badge" style="max-width:200px; margin:12px auto; text-align:center;"> |
| | | <a href="$profile_url" target="_blank" rel="noopener" |
| | |
| | | </div> |
| | | <!-- edmonton.ink Artist Badge - End --> |
| | | HTML; |
| | | return $html; |
| | | } |
| | | |
| | | /** |
| | |
| | | $container_id = 'jvb-badge' . $this->user_id; |
| | | $legacy_url = 'https://legacytattooremoval.ca'; |
| | | |
| | | $html = <<<HTML |
| | | return <<<HTML |
| | | <!-- edmonton.ink Artist Badge - Start --> |
| | | <div id="$container_id" style="max-width:150px; text-align:center;"> |
| | | <a href="$profile_url" target="_blank" rel="noopener" |
| | |
| | | </div> |
| | | <!-- edmonton.ink Artist Badge - End --> |
| | | HTML; |
| | | |
| | | return $html; |
| | | } |
| | | |
| | | /** |
| | |
| | | protected function getArtistStyles():array |
| | | { |
| | | $styles = []; |
| | | $top_styles = $this->meta->getValue('top_style'); |
| | | $top_styles = $this->meta->get('top_style'); |
| | | |
| | | if (!empty($top_styles)) { |
| | | $style_ids = explode(',', $top_styles); |
| | | foreach ($style_ids as $style_id) { |
| | | $term = get_term((int) $style_id, BASE . 'style'); |
| | | if ($term && !is_wp_error($term)) { |
| | | $styles[] = $term->name; |
| | | $styles[] = html_entity_decode($term->name); |
| | | } |
| | | } |
| | | } |
| | |
| | | $container_id = 'jvb-badge-img-' . $this->user_id; |
| | | $legacy_url = 'https://legacytattooremoval.ca'; |
| | | |
| | | $html = <<<HTML |
| | | return <<<HTML |
| | | <!-- edmonton.ink Artist Badge - Start --> |
| | | <div id="$container_id" style="display:inline-block;"> |
| | | <a href="$profile_url" target="_blank" rel="noopener" |
| | |
| | | </div> |
| | | <!-- edmonton.ink Artist Badge - End --> |
| | | HTML; |
| | | |
| | | return $html; |
| | | } |
| | | |
| | | /** |
| | |
| | | $image_only_code = htmlspecialchars($this->getImageOnlyEmbedCode(), ENT_QUOTES, 'UTF-8'); |
| | | $preview = $this->getEmbedCode(); |
| | | |
| | | $html = <<<HTML |
| | | return <<<HTML |
| | | <div class="jvb-embed-code-container"> |
| | | <h3>Embed Code for Your Website</h3> |
| | | <p>Copy this code to your website to show your edmonton.ink verified status and link back to your profile.</p> |
| | |
| | | </div> |
| | | </div> |
| | | HTML; |
| | | |
| | | return $html; |
| | | } |
| | | } |