Jake Vanderwerf
4 hours ago b7aed073c23396afa7eccb488dd25bfa222c1819
edmontonink.php
@@ -47,8 +47,15 @@
        return;
    }
    $site = Site::getInstance();
    $site->set('icons', 'light');
    $site->set('icons', 'regular');
    $site->setAll([
        'is_directory',
        'membership',
        'dashboard',
        'magic_link',
        'feed_block',
        'favourites',
        'help_menu'
//        'has_map',
//        'referrals',
    ]);
@@ -56,100 +63,46 @@
        'cloudflare',
        'facebook',
        'gmb',
        'maps',
        'helcim',
        'postmark',
        'instagram',
        'umami'
    ]);
    $login = $site->login();
}
/**
 * Defines base options like:
 *         - directory & Membership
 *         - dashboard
 *         - membership settings (JVB_MEMBERSHIP)
 *         - post types (JVB_CONTENT)
 *         - taxonomies (JVB_TAXONOMY)
 *         - User Roles (JVB_USER)
 *         - enthusiast     = (bool) short form for a subscriber-like user that can collect content for reference
 *         - forum            = (bool) create a forum
 *         - member_only    = (bool) if forum and this is true, creates a member-only forum in the custom dashboard
 *
 * as well as central filters for
 *         - rewrite rules
 *         - archive title
 */
add_filter('jvb_site', 'aei_setup_site');
function aei_setup_site():array
add_action('plugins_loaded', 'aei_membership_settings', 10);
function aei_membership_settings():void
{
    return [
        'icons'               => 'light',
        'is_directory'        => false,        //as in, a membership directory
        'has_membership'      => false,
        'has_map'             => true,
        'dashboard'           => true,
        'referrals'           => true,
        'magicLink'           => true,
        'support'         => false,
        'feed_block'      => false,
        'email_notifications' => false,
        'integrations'  => [
            'bluesky'     => false,
            'cloudflare'  => true,
            'facebook'    => true,
            'maps'        => true,
            'gmb'         => true,
            'helcim'      => true,
            'postmark'    => true,
            'instagram'   => true,
            'square'      => false,
            'umami'       => true,
        ],
        'is_restaurant'       => false,
        'limit_hours'         => false,
        'enthusiast'          => false,
        'favourites'          => false,    //optional flag to allow enthusiasts, but not favourites
    ];
    if (!class_exists('JVBase\base\Site')) {
        return;
    }
    $site = Site::getInstance();
    $membership = $site->membership();
    $membership->setAll([
        'invitable',
        'term_approval',
        'member_verified'
    ]);
    $membership->setInvitable([
        'artist'    => ['artist', 'enthusiast'],
        'enthusiast' => ['enthusiast']
    ]);
    $membership->setApprovers(['artist']);
    $membership->setCanSeeForum(['artist']);
}
/**
 * JVB_MEMBERSHIP defines the structure of the directory
 *         Options include:
 *         - membership_expires        = useful if members pay a yearly membership fee
 *         - hide_expired                = removes users once membership expired; only used if membership_expires is true
 *         - clip_expired                = keeps users once membership expires, but limits the information shown; only used if membership_expires is true
 *         - membership_approval        = verified users can approve other users
 *         - term_approval              = (bool) verified users can create new terms, but needs approval
 *          - member_only              = (array) if empty, open to any registered user. otherwise an array of registered user roles
 */
//add_filter('jvb_membership', 'aei_setup_membership');
//function aei_setup_membership():array
//{
//    return [
//        'member_content'  => true,
//        'can_invite'      => ['artist' => ['artist']],
//        'member_verified' => true,
//        'notifications'   => true,
//        'forum'           => true,
//        'member_only'     => [ 'artist' ],
//        'member_expires'  => false,
//        'hide_expired'    => false,
//        'clip_expired'    => false,
//        'term_approval'   => true,
//        'can_approve'     => [ 'artist' ]
//    ];
//}
//
//add_filter('jvbLoadingQuips', 'aei_loading_quips');
//function aei_loading_quips(array $quips):array
//{
//    return [];
//}
add_filter('jvbBelowHeader', 'aei_header');
function aei_header(string $header):string
{
    return '<p>FREE LOCAL PICKUP at <a href="https://legacytattooremoval.ca/">Legacy Tattoo Removal</a>.</p>';
}
//add_filter('jvbBelowHeader', 'aei_header');
//function aei_header(string $header):string
//{
//    return '<p>FREE LOCAL PICKUP at <a href="https://legacytattooremoval.ca/">Legacy Tattoo Removal</a>.</p>';
//}
@@ -200,7 +153,7 @@
function alyns_acknowledgement():string
{
    return '<p>amiskwacîwâskahikan ᐊᒥᐢᑲᐧᒋᐋᐧᐢᑲᐦᐃᑲᐣ</p><p><a href="https://www.treatysix.org/#comp-lkljqlw1" title="Learn More">Treaty 6 territory</a></p><p>Edmonton, Alberta, Canada</p>';
    return '<p class="text-center">Respectfully, this land was <a href="https://edmonton.ink/amiskwaciwaskahikan/" data-type="page" data-id="4659">Amiskwaciwâskahikan</a> before it was ever Edmonton.</p>';
}
@@ -227,19 +180,88 @@
add_filter('jvbRandomFooterText', 'aei_footer_text');
function aei_footer_text(string $text):string
{
    $privacy = get_privacy_policy_url();
    $privacy = ($privacy === '') ? '' : ' | <a href="'.$privacy.'">Privacy Policy</a>';
    return '<p class="font-small">©'.date('Y').' <a href="https://madimori.ca/">Madi Mori</a>'.$privacy.'</p><p class="font-small">Built with ♡ by <a href="https://jakevan.ca">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>';
}
add_filter('jvbRegisterCustomIcons', 'aei_custom_icons');
function aei_custom_icons(array $icons):array
{
    $icons['background'] = AEI_DIR . '/assets/icons/background.svg';
//    $icons['logo-jakevan'] = AEI_DIR . '/assets/icons/logo-concentric-jakevan.svg';
//    $icons['logo-right'] = AEI_DIR . '/assets/icons/logo-right-aligned.svg';
//    $icons['logo-right-jakevan'] = AEI_DIR . '/assets/icons/logo-right-aligned-jakevan.svg';
//    $icons['jakevan'] = AEI_DIR . '/assets/icons/jakevan.svg';
//    $icons['loading'] = AEI_DIR . '/assets/icons/loading.svg';
    $icons['logo'] = AEI_DIR . '/assets/icons/edmonton-ink-logo.svg';
    $icons['logo-text'] = AEI_DIR . '/assets/icons/edmonton-ink-circle.svg';
    return $icons;
}
add_filter('jvbMapIcons', 'aei_icons_map');
function aei_icons_map(array $icons):array
{
    return array_merge($icons, [
       'tattoo'     => 'drop-simple',
       'event'      => 'calendar',
       'piercing'   => 'needle',
       'artwork'    => 'palette',
       'artform'    => 'shapes',
       'city'       => 'map-pin',
        'piercing-type' => 'nut',
        'theme'     => 'folder-open',
        'style'     => 'hash',
        'colour'    => 'drop',
        'placement' => 'person-arms-spread',
        'media'     => 'squares-four',
        'artist'    => 'user',
        'artists'   => 'users-three',
        'partner'   => 'currency-circle-dollar',
        'shop'      => 'storefront',
        'past'      => 'clock-counter-clockwise',
        'future'    => 'clock-clockwise',
        'offer'     => 'hand-heart',
    ]);
}