| | |
| | | * Outputs a random link to Legacy Tattoo Removal |
| | | * @return string |
| | | */ |
| | | if (!function_exists('jvbRandomFooterText')) { |
| | | function jvbRandomFooterText():string |
| | | { |
| | | $aOpen = '<a href="https://legacytattooremoval.ca" title="Learn more about Legacy Tattoo Removal">'; |
| | | $options = array( |
| | | [ |
| | | 'text' => 'Built with ♡ by '.$aOpen.'your friendly neighbourhood laser nerds</a>.', |
| | | 'weight' => 25 |
| | | ], |
| | | [ |
| | | 'text' => 'Built with ♡ by your friends at '.$aOpen.'Legacy Tattoo Removal</a>.', |
| | | 'weight' => 15 |
| | | ], |
| | | [ |
| | | 'text' => 'Your friendly '.$aOpen.'Edmonton tattoo removal</a> crew.', |
| | | 'weight' => 15 |
| | | ], |
| | | [ |
| | | 'text' => $aOpen.'tattoo removal with ♡</a>', |
| | | 'weight' => 15 |
| | | ], |
| | | [ |
| | | 'text' => 'From '.$aOpen.'cover ups to fresh starts</a> - we\'re the laser nerds with ♡.', |
| | | 'weight' => 10 |
| | | ], |
| | | [ |
| | | 'text' => $aOpen.'See the difference at Legacy Tattoo Removal</a>', |
| | | 'weight' => 10 |
| | | ], |
| | | [ |
| | | 'text' => 'Make space for your next tattoo at '.$aOpen.'Legacy Tattoo Removal</a>.', |
| | | 'weight' => 10 |
| | | ], |
| | | [ |
| | | 'text' => $aOpen.'We\'re your artist\'s secret weapon</a>.', |
| | | 'weight' => 15 |
| | | ] |
| | | ); |
| | | |
| | | $totalWeight = 0; |
| | | foreach ($options as $option) { |
| | | $totalWeight += (int)$option['weight']; |
| | | } |
| | | |
| | | $randomNumber = mt_rand(1, $totalWeight); |
| | | $weightSum = 0; |
| | | |
| | | foreach ($options as $option) { |
| | | $weightSum += (int)$option['weight']; |
| | | if ($randomNumber <= $weightSum) { |
| | | return '<p>'.$option['text'].'</p>'; |
| | | } |
| | | } |
| | | |
| | | return '<p>'.$options[0]['text'].'</p>'; |
| | | } |
| | | function jvbRandomFooterText():string |
| | | { |
| | | $privacy = get_privacy_policy_url(); |
| | | $privacy = ($privacy === '') ? '' : ' | <a href="'.$privacy.'">Privacy Policy</a>'; |
| | | return apply_filters('jvbRandomFooterText', '<p class="font-small">©'.date('Y').' <a href="'.get_home_url().'">'.get_bloginfo('name').'</a>'.$privacy.'</p><p class="font-small">Built with ♡ by <a href="https://jakevan.ca?ref='.urlencode(get_home_url()).'">Jake Van</a></p>'); |
| | | // |
| | | // $aOpen = '<a href="https://legacytattooremoval.ca" title="Learn more about Legacy Tattoo Removal">'; |
| | | // $options = array( |
| | | // [ |
| | | // 'text' => 'Built with ♡ by '.$aOpen.'your friendly neighbourhood laser nerds</a>.', |
| | | // 'weight' => 25 |
| | | // ], |
| | | // [ |
| | | // 'text' => 'Built with ♡ by your friends at '.$aOpen.'Legacy Tattoo Removal</a>.', |
| | | // 'weight' => 15 |
| | | // ], |
| | | // [ |
| | | // 'text' => 'Your friendly '.$aOpen.'Edmonton tattoo removal</a> crew.', |
| | | // 'weight' => 15 |
| | | // ], |
| | | // [ |
| | | // 'text' => $aOpen.'tattoo removal with ♡</a>', |
| | | // 'weight' => 15 |
| | | // ], |
| | | // [ |
| | | // 'text' => 'From '.$aOpen.'cover ups to fresh starts</a> - we\'re the laser nerds with ♡.', |
| | | // 'weight' => 10 |
| | | // ], |
| | | // [ |
| | | // 'text' => $aOpen.'See the difference at Legacy Tattoo Removal</a>', |
| | | // 'weight' => 10 |
| | | // ], |
| | | // [ |
| | | // 'text' => 'Make space for your next tattoo at '.$aOpen.'Legacy Tattoo Removal</a>.', |
| | | // 'weight' => 10 |
| | | // ], |
| | | // [ |
| | | // 'text' => $aOpen.'We\'re your artist\'s secret weapon</a>.', |
| | | // 'weight' => 15 |
| | | // ] |
| | | // ); |
| | | // |
| | | // $totalWeight = 0; |
| | | // foreach ($options as $option) { |
| | | // $totalWeight += (int)$option['weight']; |
| | | // } |
| | | // |
| | | // $randomNumber = mt_rand(1, $totalWeight); |
| | | // $weightSum = 0; |
| | | // |
| | | // foreach ($options as $option) { |
| | | // $weightSum += (int)$option['weight']; |
| | | // if ($randomNumber <= $weightSum) { |
| | | // return '<p>'.$option['text'].'</p>'; |
| | | // } |
| | | // } |
| | | // |
| | | // return '<p>'.$options[0]['text'].'</p>'; |
| | | } |
| | | |