![]() |
[HDI] Set Up My Custom Field to check if the value is proper.
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? |
file_exists() does not work on remote files, so you can't use that. Try using file() with implode() instead.
|
All times are GMT. The time now is 01:40 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|