Welcome Guest [Log In] [Register]
Add Reply
Avatar System
Topic Started: Aug 14 2008, 10:58 PM (1,640 Views)
feartec

yes it has to be in the includes folder, because if you do it in an other folder, it will give an error. I dont know why.
It gives an error if you add ../images/avatar .
Offline Profile Quote Post Goto Top
 
JakkyD
Member Avatar

also in process function edit account do you have to add this:

function procEditAccount(){
global $session, $form;
/* Account edit attempt */
$retval = $session->editAccount($_POST['user'], $_POST['pass'], $_POST['email'], $_FILES['avatar']['name'], $_FILES['avatar']['size'], $_FILES['avatar']['type'], $_FILES['avatar']['tmp_name']);
Offline Profile Quote Post Goto Top
 
feartec

ow sorry, forget to post that :P , thanks!
Offline Profile Quote Post Goto Top
 
JakkyD
Member Avatar

right its now working, but it wont display on userinfo, it gets to /avatar/[username]/ then stops, doesnt give the file name

helpz :P
Edited by JakkyD, Sep 1 2008, 03:56 PM.
Offline Profile Quote Post Goto Top
 
feartec

do you have an url ?
Offline Profile Quote Post Goto Top
 
JakkyD
Member Avatar

http://dbjdtutorials.co.uk/test/userinfo.php?user=avatar

The avatar image URL = http://dbjdtutorials.co.uk/test/include/avatar/avatar/

I dont know how to get the end :(
Edited by JakkyD, Sep 1 2008, 04:00 PM.
Offline Profile Quote Post Goto Top
 
feartec

this code is the good one,
Code:
 

<?
$query=mysql_query("SELECT avatar FROM users WHERE username='$req_user'");
$row=mysql_fetch_row($query);
$avatar=$row[0];
$noavatar="noavatar.png";

if($avatar == $noavatar){
?>
<img src="path/to/include/avatar/<? echo $avatar; ?>">
<?
} else {
?>
<img src="path/to/include/avatar/<? echo $req_user; ?>/<? echo $avatar; ?>">
<?
}
?>
Offline Profile Quote Post Goto Top
 
JakkyD
Member Avatar

Hmm when I register the name doesnt change, stays as the number: http://dbjdtutorials.co.uk/test/include/avatar/tester/1220290547

Its weird because the right file is in the folder :/
Edited by JakkyD, Sep 1 2008, 05:40 PM.
Offline Profile Quote Post Goto Top
 
feartec

it save the time not the name of the avatar, weird ?!
Offline Profile Quote Post Goto Top
 
feartec

change the addnewuser function to this :

Code:
 


function addNewUser($username, $password, $email, $avatar){
$time = time();
/* If admin sign up, give admin user level */
if(strcasecmp($username, ADMIN_NAME) == 0){
$ulevel = ADMIN_LEVEL;
}else{
$ulevel = USER_LEVEL;
}
$q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password', '0', $ulevel, '$email', '$avatar', $time)";
return mysql_query($q, $this->connection);
}
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Other · Next Topic »
Add Reply