Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Can Vanillicon overide facebook / twitter images

Hello,

On my forum I'd like to use the Vanillicon even when someone signs up with facebook or twitter.

Is this possible?

thanks

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    From my experience, no. You can change your image in the forum but as soon as you log in again with fb or tw it fetches the image again..

  • Options
    noncenonce Necro-on Forensics
    edited March 2016

    if the experience above is correct, which we will assume is accurate.

    it is a a pretty kettle of fish, but you can Horse around with the plugins with a bit of monkey business.

    untested but based on above input and a quick scan of the code, potentially you can with some effort.

    Change What goes in... sanitize the input as

    in facebook plugin

        $Form->setFormValue('Photo', "//graph.facebook.com/{$ID}/picture?type=large");
    

    change "//graph.facebook.com/{$ID}/picture?type=large" to ""

    in twitter plugin

        $Form->setFormValue('Photo', val('profile_image_url_https', $Profile));
    

    change val('profile_image_url_https', $Profile) to ""

    if the reset occurs on connection there is no need to modify the user table.

    if you decide you want to affect the output instead change what comes out sanitize the output

    override the UserPhoto in the functions.render.php via the bootstrap method.

    look for if ($Photo) {
    if (!isUrl($Photo)) {

    above those two line - add
    // check for photo and is it a url. if the url matches twimg or facebook set the photo to "".
    if ($Photo) {
    if (isUrl($Photo)) {
    if (preg_match('/twimg/',$Photo)) {
    $Photo = "";
    }
    if (preg_match('/facebook/',$Photo)) {
    $Photo = "";
    }
    }
    }

    in the vanillicon plugin look for (this affects the pic on the profile page).

        if (!$Sender->User->Photo)
    

    and do something similar setting the $Sender->User->Photo to "" if it matches either "facebook" or "twimg".

    you will need to decide if it is worth the effort.

  • Options
    noncenonce Necro-on Forensics

    with UserPhoto override

        if ($FullUser && $FullUser['Banned']) {
            $Photo = C('Garden.BannedPhoto', 'https://images.v-cdn.net/banned_large.png');
            $Title .= ' ('.T('Banned').')';
        }
    

    // TRY ADDING CODE HERE....
    // check for photo and is it a url. if the url matches twimg or facebook set the photo to "".
    if ($Photo) {
    if (isUrl($Photo)) {
    if (preg_match('/twimg/',$Photo)) {
    $Photo = "";
    }
    if (preg_match('/facebook/',$Photo)) {
    $Photo = "";
    }
    }
    }

        if (!$Photo && function_exists('UserPhotoDefaultUrl')) {
            $Photo = UserPhotoDefaultUrl($User, $ImgClass);
        }
    
        if ($Photo) {
            if (!isUrl($Photo)) {
                $PhotoUrl = Gdn_Upload::Url(ChangeBasename($Photo, 'n%s'));
    
  • Options

    Thanks so much, i will give that a whirl

Sign In or Register to comment.