ibeblunt
02-27-2002, 06:45 PM
Recently, I added a tiny hack to my site for the avatars.
Basically, I don't allow people to upload avatars to my site anymore. So I created a custom field and the user has to type the URL of the avatar that he wants to use.
However, there is one problem for about 50% of the users. There are some users who copy their hard drive path and some users who use a path that doesn't work.
I know in php I would use file_exists($userinfo[field8]) to check for the existance of an image but when I tried that it didn't appear to working.
How can I check that $post[field8] contains a working path?
Here is the hack:
admin/functions.php
Inserted around line # 181:
if ($post[field8]) {
$post[field8] = "<img width=\"50\" height=\"50\" src=\"" . $post[field8] . "\" border=\"0\">";
}
Any suggestions?
Basically, I don't allow people to upload avatars to my site anymore. So I created a custom field and the user has to type the URL of the avatar that he wants to use.
However, there is one problem for about 50% of the users. There are some users who copy their hard drive path and some users who use a path that doesn't work.
I know in php I would use file_exists($userinfo[field8]) to check for the existance of an image but when I tried that it didn't appear to working.
How can I check that $post[field8] contains a working path?
Here is the hack:
admin/functions.php
Inserted around line # 181:
if ($post[field8]) {
$post[field8] = "<img width=\"50\" height=\"50\" src=\"" . $post[field8] . "\" border=\"0\">";
}
Any suggestions?