Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Suggestions Default Avatar
Yuuri
Posted on 04 Jul 2009, 21:40:04

Access: Member
Total Posts: 13
Joined: 2009-07-03

I think it would be really cool if visitors that comment could have a default avatar if they don't provide one.
#580
Chris
Posted on 04 Jul 2009, 21:45:11

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

That shouldn't be to difficult to do, I'll make a small change to the script later and post it here.
#581
Chris
Posted on 04 Jul 2009, 22:29:27

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

If you edit the index.php file and scroll down to line 1074 you'll see this bit of code

Code:
if(mysql_num_rows($queryu) == "1"){
$avatar = "<img src=\"" . mysql_result($queryu,0) . "\" />";
}else{
$avatar = '';
}

simply change that to

Code:
if(mysql_num_rows($queryu) == "1"){
$avatar = "<img src=\"" . mysql_result($queryu,0) . "\" />";
}else{
$avatar = '<img src="http://yourdomain.com/images/defaultavatar.jpg" />';
}

Replacing http://yourdomain.com/images/defaultavatar.jpg with your own image.

Save and upload, anyone who hasn't specified an avatar will now use the default one.
#582
Last edited by Chris at 2009-07-04 22:31:33 Reason:
Yuuri
Posted on 05 Jul 2009, 16:15:57

Access: Member
Total Posts: 13
Joined: 2009-07-03

Oh, thank you very much. This will come in handy. =)
#583
Network-13.com © 2013