From 5a6906f710e9333507486df3cbb545a67a040881 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 24 May 2026 02:26:17 +0000
Subject: [PATCH] =Minor changes to email.php, which had info for Legacy and edmonton.ink hardcoded in it. Added a colours.php and JVB_COLOURS constant to define our base, contrast, action, and secondary colours for use within php templates
---
base/_setup.php | 1
base/colours.php | 26 +++++++++++++
inc/managers/DirectoryManager.php | 5 +-
base/email.php | 37 +++++-------------
inc/managers/EmailManager.php | 4 +-
inc/helpers/legacy.php | 2
inc/managers/SEO/BreadcrumbManager.php | 11 -----
7 files changed, 45 insertions(+), 41 deletions(-)
diff --git a/base/_setup.php b/base/_setup.php
index b8ec0e2..077e84f 100644
--- a/base/_setup.php
+++ b/base/_setup.php
@@ -10,6 +10,7 @@
Site::getInstance();
}
//require(JVB_DIR.'/base/content.php');
+require(JVB_DIR.'/base/colours.php');
require(JVB_DIR.'/base/email.php');
//require(JVB_DIR.'/base/taxonomies.php');
//require(JVB_DIR.'/base/users.php');
diff --git a/base/colours.php b/base/colours.php
new file mode 100644
index 0000000..17d89de
--- /dev/null
+++ b/base/colours.php
@@ -0,0 +1,26 @@
+<?php
+
+$defaults = [
+ 'action-0' => '#ff0080',
+ 'action-50' => '#ff2492',
+ 'action-100' => '#ff47a4',
+ 'action-200' => '#ff6bb5',
+ 'secondary-0' => '#D69121',
+ 'secondary-50' => '#ffc421',
+ 'secondary-100' => '#ffcd44',
+ 'secondary-200' => '#ffd768',
+ 'light' => '#efefef',
+ 'light-50' => '#e2e2e2',
+ 'light-100' => '#d5d5d5',
+ 'light-200' => '#c9c9c9',
+ 'dark' => '#151515',
+ 'dark-50' => '#222222',
+ 'dark-100' => '#2e2e2e',
+ 'dark-200' => '#3b3b3b',
+ 'action-contrast'=> '',
+ 'secondary-contrast'=> '',
+];
+
+
+$jvbColours = apply_filters('jvb_colours', $defaults);
+define('JVB_COLOURS', $jvbColours);
diff --git a/base/email.php b/base/email.php
index 81865b2..b6fcd4e 100644
--- a/base/email.php
+++ b/base/email.php
@@ -1,37 +1,22 @@
<?php
+$name = get_bloginfo('name');
+$desc = get_bloginfo('description');
$defaults = [
- 'colours' => [
- 'action-0' => '#ff0080',
- 'action-50' => '#ff2492',
- 'action-100' => '#ff47a4',
- 'action-200' => '#ff6bb5',
- 'secondary-0' => '#D69121',
- 'secondary-50' => '#ffc421',
- 'secondary-100' => '#ffcd44',
- 'secondary-200' => '#ffd768',
- 'light' => '#efefef',
- 'light-50' => '#e2e2e2',
- 'light-100' => '#d5d5d5',
- 'light-200' => '#c9c9c9',
- 'dark' => '#151515',
- 'dark-50' => '#222222',
- 'dark-100' => '#2e2e2e',
- 'dark-200' => '#3b3b3b',
- 'action-contrast'=> '',
- 'secondary-contrast'=> '',
- ],
'content' => [
- 'title' => get_bloginfo('name'),
- 'subjectPrefix' => '['.get_bloginfo('name').']',
- 'signature' => '<p>  — ♡ the edmonton.ink crew</p>',
+ 'title' => $name,
+ 'subjectPrefix' => '['.$name.']',
+ 'signature' => '<p>  — ♡ '.$name.'</p>',
'footer' => [
- '<p>© ' . date('Y') . ' edmonton.ink — Your tattoo scene on your screen.</p>',
- '<p><a href="' . get_home_url() . '" class="text-link">edmonton.ink</a></p>'
+ '<p>© ' . date('Y') . ' '.$name.' — '.$desc.'</p>',
+ '<p><a href="' . get_home_url() . '" class="text-link">'.get_home_url().'</a></p>'
]
],
'types' => [
'newUser' => [
- 'subject' => 'Welcome to Legacy! Finish creating your account.',
+ 'subject' => sprintf(
+ 'Welcome to %s! Finish creating your account.',
+ get_bloginfo('name')
+ ),
'showPrefix' => true,
],
'resetPass' => [
diff --git a/inc/helpers/legacy.php b/inc/helpers/legacy.php
index 79377ab..a5f3c6e 100644
--- a/inc/helpers/legacy.php
+++ b/inc/helpers/legacy.php
@@ -13,7 +13,7 @@
{
$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">Jake Van</a></p>');
+ 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(
diff --git a/inc/managers/DirectoryManager.php b/inc/managers/DirectoryManager.php
index c81010d..a4ebc71 100644
--- a/inc/managers/DirectoryManager.php
+++ b/inc/managers/DirectoryManager.php
@@ -85,6 +85,7 @@
public function getDirectories():array
{
$directories = get_option(BASE.'directories');
+
if (!$directories) {
$directories = [];
//content
@@ -134,7 +135,7 @@
$title = $config['title'];
//Bail early if we've already created the page
$existing = new WP_Query([
- 'post_type' => BASE.'dash',
+ 'post_type' => BASE.'directory',
'name' => sanitize_title($title),
'posts_per_page' => 1,
]);
@@ -228,7 +229,6 @@
// ];
// }
// }
-
if (!empty($created)) {
update_option(BASE.'directory_ids', $created);
}
@@ -240,6 +240,7 @@
protected function buildDirectoryList():array
{
$saved = get_option(BASE.'directory_list', []);
+
if (empty($saved)) {
$all = new WP_Query([
'post_type' => BASE.'directory',
diff --git a/inc/managers/EmailManager.php b/inc/managers/EmailManager.php
index 68bbdef..e480a06 100644
--- a/inc/managers/EmailManager.php
+++ b/inc/managers/EmailManager.php
@@ -24,7 +24,7 @@
class EmailManager
{
- public array $colours = JVB_EMAIL['colours'];
+ public array $colours;
private string $title = JVB_EMAIL['content']['title'];
private string $prefix = JVB_EMAIL['content']['subjectPrefix'];
private string $signature = JVB_EMAIL['content']['signature'];
@@ -42,7 +42,7 @@
$this->site_name = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$this->site_url = get_site_url();
$this->footer = (is_array(JVB_EMAIL['content']['footer'])) ? implode('', JVB_EMAIL['content']['footer']) : JVB_EMAIL['content']['footer'];
-
+ $this->colours = JVB_COLOURS;
add_filter('wp_mail_content_type', [$this, 'setHtmlContentType']);
// User registration emails
add_filter('wp_new_user_notification_email', [$this, 'customizeNewUserEmail'], 999, 3);
diff --git a/inc/managers/SEO/BreadcrumbManager.php b/inc/managers/SEO/BreadcrumbManager.php
index 299d396..041d37e 100644
--- a/inc/managers/SEO/BreadcrumbManager.php
+++ b/inc/managers/SEO/BreadcrumbManager.php
@@ -172,16 +172,6 @@
$crumbConfig = $registrar->getConfig('breadcrumbs');
}
- if($registrar && $registrar->hasFeature('show_directory')) {
- $directory = JVB()->directories();
- if ($directory && !empty($directory->directories($content)??[])){
- $crumbs[] = [
- 'name' => $directory->directories($content)['title'],
- 'url' =>$directory->directories($content)['url']
- ];
- }
- }
-
// Handle directory posts specially
if (JVB()->directories() && JVB()->directories()->isDirectory()) {
$pos = jvbGetDirectoryInfo();
@@ -226,6 +216,7 @@
if($registrar && $registrar->hasFeature('show_directory') && JVB()->directories()) {
$directory = JVB()->directories();
+
if ($directory && !empty($directory->directories($name)??[])){
$crumbs[] = [
'name' => $directory->directories($name)['title'],
--
Gitblit v1.10.0