Welcome Guest [Log In] [Register]
Add Reply
Avatar System (Fixed - Fully working and tested)
Topic Started: Dec 18 2008, 01:28 AM (1,429 Views)
laurens

I just can't get this in my login system. When I add it other function (as email activation) does't work anymore.
Please can someone sent me the AUS? I don't know where to get it..
Offline Profile Quote Post Goto Top
 
php-coder
Member Avatar

The AUS Is not completed, there isnt enough dedication from the lead coders, and the avatar system does fully work if it fails to work your A, either missing something out (A change) or B, your not changing something correctly, now i dont have a great deal of time to do this for you today and im having some server issues so my server is at this time un reachable but once i do have more time and i am back on track ill sort out your problem,
Offline Profile Quote Post Goto Top
 
hansmaulwurf

i had the problem, that after i've upladed an gif or an png the transparency was gone.

the white background turned into a black one.

but i've found a way out of this...

at the end of the session.php i inserted the folowing function:

Quote:
 
function setTransparency($new_image,$image_source)
{

$transparencyIndex = imagecolortransparent($image_source);
$transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255);

if ($transparencyIndex >= 0) {
$transparencyColor = imagecolorsforindex($image_source, $transparencyIndex);
}

$transparencyIndex = imagecolorallocate($new_image, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']);
imagefill($new_image, 0, 0, $transparencyIndex);
imagecolortransparent($new_image, $transparencyIndex);

}


and then during the resizing process of the image i inserted after this:

Quote:
 
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefrompng($savatar_tmpname);


the following functioncall:

Quote:
 
setTransparency($image_p,$image);


so the transparency doesn't get lost through the upload!

have fun! ;)
Offline Profile Quote Post Goto Top
 
php-coder
Member Avatar

All these little problems were initially fixed, i uploaded parts of the old code as i was having alot of problems at the time of uploading so my head was all over the place, but its nice to see people putting in time to help others with bugs and the likes.

Pc~
Offline Profile Quote Post Goto Top
 
Vimto

I took about 2 hours to get this to work fully but eventually got there.

in process.php under procEditAccount function, make sure it says

$retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email'], $_FILES['avatar']['name'], $_FILES['avatar']['size'], $_FILES['avatar']['type'], $_FILES['avatar']['tmp_name']);


This only creates a new directory for new users, so all previous users end up not being able to upload an avatar. To fix this:

in session.php

find:

if(!$avatar_tmpname){
$form->setError($field, "* Avatar does not exist");
} else {

and add after it

if (!is_dir($uploaded_dir)){
mkdir("YOUR/FULL/PATH/uploads/avatars/$this->username", 0777);
}

I decided "include/avatar" wasnt the best place for avatars and put them in an uploads directory.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Other · Next Topic »
Add Reply