Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Account Pictures

123578

Comments

  • awww, crap. can anybody tell me how to chmod the files. the server i'm working at has some problems with this stugg, so i have to define the chmod value somewhere...
  • I have been trying to give myself an icon for the past 2 weeks now, and after I save the icon in the Account Pictures settings page, it redirects me to a blank page with a little black square icon in the upper left corner that reads nogd. What does that mean??? I have made the upload folder, set my permissions right and it just won't work for me.
    Come to find out, it has something to to with php-gd. You have to have it installed. I didn't. So for all you guys who get that little icon of noGD, now you know. -actually, it might be a good idea to list php-gd as one of the requirements in the AccountPictures "read me" file so the user doesn't have to go searching all over the net trying to find out what that little nogd icon means. For the beginner, I think it should be easier than this.
  • "I was running into a problem where if I specified both the icon and account picture on the same submit I got "cannot redeclare phpThumb class", so I changed line 148 to include_once rather than include and that seems to have fixed it." I had the same problem, came to the same conclusion, did the same fix. :)
  • The problem I'm finding at the moment, is someone has specified an off-site image as their icon. Although it's 32 pixels wide. It's something like 128 pixels tall. It works fine if you upload a picture through the interface. I'm tempted to just edit the code so people can't inject a URL themselves, as this appears to the be only issue. And honestly, I think I'd sooner disable off-site images anyway. But on the off chance, has anyone else had this problem and/or fixed it? I'm using GD, not ImageMagick btw. Update: I didn't realise, but the ability to have an avatar as an off-site URL is built into Vanilla. The add-on is working perfectly, but it conflicts with the built in functionality. Is there a way of easily removing the options for those URLs in the Account settings, without editing too many files? Update 2: I have removed this functionality, by editing account_identity_form.php. Search for the line with "GetDefinition('AccountPicture') and I've changed the code to the following, which basically remarks the old code and adds in two hidden elements with the previous data in, to stop the values being erased. This doesn't protect against POST injection, but that's not a huge problem. /* echo '<li> <label for="txtPicture">'.$this->Context->GetDefinition('AccountPicture').'</label> <input type="text" name="Picture" value="'.$this->User->Picture.'" maxlength="255" class="SmallInput" id="txtPicture" /> <p class="Description"> '.$this->Context->GetDefinition('AccountPictureNotes').' </p> </li> <li> <label for="txtIcon">'.$this->Context->GetDefinition('Icon').'</label> <input type="text" name="Icon" value="'.$this->User->Icon.'" maxlength="255" class="SmallInput" id="txtIcon" /> <p class="Description"> '.$this->Context->GetDefinition('IconNotes').' </p> </li> </ul>'; */ //new code echo '<input type="hidden" name="Picture" value="'.$this->User->Picture.'" maxlength="255" class="SmallInput" id="txtPicture" /> <input type="hidden" name="Icon" value="'.$this->User->Icon.'" maxlength="255" class="SmallInput" id="txtIcon" />';
  • As administrator I tried to go into a user profile and upload a new avatar for them, it does not show the users account photos area though it shows the administrators, seems like a bug
  • Jazz, The Account Pictures and the Vanea Black theme aren't playing nice with each other. http://methodic.org/temp/badicon.gif help? thanks!
  • When I upload a new account picture that's portrait - say 600 long, 200 wide. I would expect it to resize it to the maximum height, and then crop the width - not the other way around. In my eyes, it needs some portait/landscape detection to know which takes priority, width or height.
  • Update: fixed a bug with people who don't have an uploaded image. The following modification will IGNORE the height value. Any image will be resized to the set width (280 default). This is great for uploading portrait images. First, find: $this->Picture = $User->Picture . '?' . time(); And afterwards add: if ($User->Picture) { $imagedetails = getimagesize($this->Picture); $this->PictureHeight = $imagedetails[1]; } else { $this->PictureHeight=0; } This gets the size of the uploaded image, so that the style is set correctly on the image with viewing the images on the upload page. Then, find: $phpThumb->setParameter('h', $NewHeight); And remark the line. This means that only a new width is passed to phpthumb and is therefore scaled proportionally. Then find: $AddStyle = str_replace('{PictureHeight}', $Context->Configuration['ACCOUNTPICTURES_PICTURE_HEIGHT'], $AddStyle); And replace it with: $AddStyle = str_replace('{PictureHeight}', $pheight, $AddStyle); Any time before this line, say above all the $AddStyle declarations, add: $pheight = $Context->Configuration['ACCOUNTPICTURES_PICTURE_HEIGHT']; if ($Context->SelfUrl == 'account.php' && $Context->Session->UserID > 0) { $tuser = $UserManager->GetUserById($Context->Session->UserID); if ($tuser->Picture) { $imagedetails = getimagesize($tuser->Picture . '?' . time()); $pheight = $imagedetails[1]; } } And you're done! Note that this uses the GD library to get the image details. So if you're using ImageMagick, unless you have GD compiled as well, this won't work.
  • anyone else notice that you cannot upload a avatar and a profile picture at the same time?
  • It has been mentioned. Possibly something to do with the upload class being used twice and causing conflicts or something. hmm..
  • Michael - I had that problem, as did someone else, to quote "so I changed line 148 to include_once rather than include and that seems to have fixed it."
  • ok I'll give it a try tonight and let you know
  • the include_once doesn't fix the avatar showing up lower than the username with the VaneaBlack theme. any ideas?

    image
  • Lament - the include_once wasn't meant to fix that, it fixes uploading both the icon and picture at the same time. For your issue, I had the same problem with the standard vanilla theme when going above the default 32x32. Your issue will be with the style sheet in some way - either the VaneaBlack theme was designed to take a smaller icon size, or wasn't designed for one at all. If you've not done much CSS, install the Web Developer plugin for FireFox and you will pretty quickly be able to diagnose what's going on :)
  • Is there any way to hide the account picture & icon url setting on the personal info page?
  • Yes - read my post above, explaining exactly how.
  • i don't see what you mean??? there's a lot of fixes above, but not for the one I want... what i want to do is hide the url setting for icons & pictures, so the only way to get one is to upload it. I think i've figured it out though, im going to look for the lines that add that in /themes/account_preferences_form.php and comment them out. Edit ***account_identity_form.php
  • okay so that's not gonna work ... it doesn't add them one at a time, it adds them all aat once, and i don't know php well enough to exclude just those ones.
  • Comment number 85 :)
  • Hello there, Thanks for the extension. However, I'm getting the error mentioned previously when attempting to upload an icon or picutre, too: phpThumb() v1.7.7-200612252156 in file "phpthumb.class.php" on line 216
Sign In or Register to comment.