Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.

Tutorial: Vanillicon cosmetic surgery. Put a smile on that.

peregrineperegrine MVP
edited August 2014 in Tutorials

you can preg_replace the image string and give all your users the same face with different colors.

Remove unwanted facial hair,,, (char 6)

with moustache

image

after clean-shaven

image

keep the gals from getting moustaches. by checking for gender and moustache.

image


get dental surgery (char)

before

image
or
image

after surgery

image
or
image or image


(char 4)

correct strabismus http://en.wikipedia.org/wiki/Strabismus

before
image

after
image

tired of the color purple (char 9)

image

tilt the head a bit (char 5)

image
image
image

want everyone on your site with the same face but a different color just replace a char or two in string.

WARNING: cosmetic surgery is not for everyone, consult your doctor first.

oops: meant to post it here: http://vanillaforums.org/addon/vanillicon-plugin

need a surgical plugin or a facelift for your site you know who to call.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Bleistivtvrijvlinder

Comments

  • This is awesome!
    I'm waiting for a "customize vanillicon" plugin :smiley:

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    peregrinevrijvlinder
  • peregrineperegrine MVP
    edited August 2014

    Thanks, I could probably do one for free that makes sure everyone has a smile. or give the female gender a heart-shaped mouth and the guys moustaches.

    But I would have to pay for malpractice insurance if I were to pursue the cosmetic surgery profession, so a really custom one would probably need a bit of sponsorship. and Botox is fairly expensive, not too mention dental implants.
    since its a bit tedious.

    But there may be aspiring surgeons out there who may do it for free just to get their scapels sharp.

    or give me some time for some days where I get bored, and decide to pursue, and the vanilla development team doesn't mind, and there are people seriously interested and would use it.

    or the senior look, maybe barber shop quartet

    imageimageimageimage

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    Bleistivtvrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
  • BleistivtBleistivt MVP
    edited August 2014

    Draft for a plugin:

    (untested)

    public function ProfileController_EditMyAccountAfter_Handler($Sender) {
    $moustaches = array(
        '1' => 'Option1',
        '2' => 'Option2',
        '3' => 'Option3'
    );
        echo Wrap(
            $Sender->Form->Dropdown('Moustache', $moustaches),
            'li',
            array('class' => 'CustomVanilliconMoustache')
        );
    }
    
    public function UserModel_AfterSave_Handler($Sender) {
        $FormValues = $Sender->EventArguments['FormPostValues'];
        $UserID = val('UserID', $FormValues, 0);
        if (!is_numeric($UserID) || $UserID <= 0)
            return;
    
        $Moustache = val('Moustache', $FormValues, false);
        $this->SetUserMeta($UserID, 'Moustache', $Moustache);
    }
    
    if (!function_exists('UserPhotoDefaultUrl')) {
        function UserPhotoDefaultUrl($User, $Options = array()) {
            $Session = Gdn::Session();
            $Email = GetValue('Email', $User);
            if (!$Email) {
                $Email = GetValue('UserID', $User, 100);
            }
            $Hash = md5($Email);
            $Moustache = Gdn::UserMetaModel()->GetUserMeta($Session->UserID, 'Plugin.CustomVanillicon.Moustache', $Hash[5]);
            $Hash[5] = array_pop($Moustache);
            $PhotoUrl = 'http://w'.substr($Hash, 0, 1).'.vanillicon.com/'.$Hash.'_50.png';
    
            return $PhotoUrl;
        }
    }
    

    edit: Forgot that GetUserMeta returns an array, edited

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    vrijvlinderperegrine
  • I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    vrijvlinderBleistivtphreak
Sign In or Register to comment.